Skip to content

While running the monthly transaction report got the error

0

2025-06-05T02:38:18.603Z ERROR 4280 --- [ Thread-16] c.n.b.g.r.job.support.GroovyJobExecutor : Unable to execute the groovy script "TRANREPT".

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: D:\PhotonUser\Workshop\workspace.metadata.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\carddemo-service\WEB-INF\classes\scripts\TRANREPT.groovy: 27: The current scope already contains a variable of the name jobName @ line 27, column 6. def jobName = "" + jobContext.getJobName() + "-" + procName ^

1 error

at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:292)
at org.codehaus.groovy.control.CompilationUnit$ISourceUnitOperation.doPhaseOperation(CompilationUnit.java:910)
at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:692)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:666)
at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:373)
at groovy.lang.GroovyClassLoader.lambda$parseClass$2(GroovyClassLoader.java:316)
at org.codehaus.groovy.runtime.memoize.StampedCommonCache.compute(StampedCommonCache.java:163)
at org.codehaus.groovy.runtime.memoize.StampedCommonCache.getAndPut(StampedCommonCache.java:154)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:314)
at com.netfective.bluage.gapwalk.rt.utils.GroovyScriptRunnerPlus.xaa(Unknown Source)
at com.netfective.bluage.gapwalk.rt.utils.GroovyScriptRunnerPlus.lambda$getScript$0(Unknown Source)
at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916)
at com.netfective.bluage.gapwalk.rt.utils.GroovyScriptRunnerPlus.getScript(Unknown Source)
at com.netfective.bluage.gapwalk.rt.utils.GroovyScriptRunnerPlus.evaluate(Unknown Source)
at com.netfective.bluage.gapwalk.rt.job.support.GroovyJobExecutor.run(Unknown Source)
at java.base/java.lang.Thread.run(Thread.java:840)

2025-06-05T02:38:18.614Z INFO 4280 --- [ Thread-16] c.n.b.g.r.job.support.DefaultJobContext : Job [578708702] - starting final operation 2025-06-05T02:38:18.617Z INFO 4280 --- [ Thread-16] c.n.b.g.r.job.support.DefaultJobContext : End of job [578708702] 2025-06-05T02:38:18.618Z INFO 4280 --- [ Thread-16] c.n.b.g.rt.script.ScriptControlTower : Removed jobExecutor [a9e72b4f-ea72-4dba-a50d-55a52896ad42] from Script Control Tower. 2025-06-05T02:38:18.619Z INFO 4280 --- [ Thread-16] c.n.b.g.rt.script.ScriptControlTower : Remaining jobExecutors:0

asked a year ago126 views

1 Answer
0

The error you're encountering is a variable redefinition issue in your TRANREPT Groovy script. The error message indicates that you have defined the variable "jobName" twice in the same scope, specifically at line 27:

"The current scope already contains a variable of the name jobName @ line 27, column 6."

This happens because the variable "jobName" is already defined earlier in your script, and then you're trying to define it again at line 27 with: def jobName = "" + jobContext.getJobName() + "-" + procName

To fix this issue, you have two options:

  1. Remove the second definition of jobName and use the existing variable
  2. Use a different variable name for the second definition, such as "newJobName" or "fullJobName"

For example, you could change line 27 to: def fullJobName = "" + jobContext.getJobName() + "-" + procName

Then use "fullJobName" instead of "jobName" in the subsequent code.

This is a common issue in Groovy scripts where variables are inadvertently redefined in the same scope. Once you make this change, your transaction report should generate successfully.
Sources
Error while generating transaction report | AWS re:Post
AWS Blu Age L3 Workshop: Unable to execute the groovy script "TRANREPT" | AWS re:Post

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.