cancel
Showing results for 
Search instead for 
Did you mean: 

Scripting engine for groovy not found inside jar, even though it is included

kayj
Champ in-the-making
Champ in-the-making
Hi,

I'm using an in memory engine. It is intialized by:
ProcessEngineConfiguration.createStandaloneInMemProcessEngineConfiguration().buildProcessEngine();


I'm using Activiti 5.17.0, Groovy is added as a dependency

<dependency>
  <groupId>org.codehaus.groovy</groupId>
  <artifactId>groovy-all</artifactId>
  <version>2.1.3</version>
</dependency>


Starting the application in my dev environment, i.e. IntelliJ, everything works fine. But after building a jar and executing the jar file via terminal an exception is thrown stating "that a scripting engine for groovy can't be found". It is thrown when the process execution reaches a ScriptTask, which contains a groovy script.

I assurred that the groovy lib is packaged into the jar. Also if I run maven:site the groovy-all dependency is listed. So it should work! What am I missing?

Best regards,

KayJ

PS: the error message is attached to a txt file. Due to unknown reasons my thread never appears in the forum. Already tried to post it several times. I'm still trying to figure out why.
9 REPLIES 9

kayj
Champ in-the-making
Champ in-the-making
…forgot the txt. But posting worked! Here is the error msg.

<code>
12:00:11.241 [main] DEBUG o.a.e.i.p.r.AtomicOperationTransitionNotifyListenerTake - ScopeExecution[15] takes transition (startevent2)–flow1–>(scripttask1)
12:00:11.241 [main] DEBUG o.a.e.i.h.DefaultHistoryManager - Current history level: AUDIT, level required: ACTIVITY
12:00:11.241 [main] DEBUG o.a.e.i.p.r.AtomicOperationActivityExecute - ScopeExecution[15] executes Activity(scripttask1): org.activiti.engine.impl.bpmn.behavior.ScriptTaskActivityBehavior
12:00:11.242 [main] WARN  o.a.e.i.b.b.ScriptTaskActivityBehavior - Exception while executing scripttask1 : Can't find scripting engine for 'groovy'
12:00:11.246 [main] DEBUG o.a.e.i.interceptor.CommandContext - Error while closing command context
org.activiti.engine.ActivitiException: Can't find scripting engine for 'groovy'
at org.activiti.engine.impl.scripting.ScriptingEngines.getEngineByName(ScriptingEngines.java:124) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.scripting.ScriptingEngines.evaluate(ScriptingEngines.java:85) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.scripting.ScriptingEngines.evaluate(ScriptingEngines.java:73) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.bpmn.behavior.ScriptTaskActivityBehavior.execute(ScriptTaskActivityBehavior.java:63) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:60) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:631) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:626) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerStart.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerStart.java:52) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:631) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:626) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:49) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:631) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:626) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionCreateScope.execute(AtomicOperationTransitionCreateScope.java:49) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:631) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:626) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerTake.execute(AtomicOperationTransitionNotifyListenerTake.java:80) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:631) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:626) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionDestroyScope.execute(AtomicOperationTransitionDestroyScope.java:116) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:631) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:626) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerEnd.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerEnd.java:35) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:631) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:626) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:49) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:631) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:626) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.take(ExecutionEntity.java:450) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.take(ExecutionEntity.java:428) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.bpmn.behavior.BpmnActivityBehavior.performOutgoingBehavior(BpmnActivityBehavior.java:140) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.bpmn.behavior.BpmnActivityBehavior.performDefaultOutgoingBehavior(BpmnActivityBehavior.java:66) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.bpmn.behavior.FlowNodeActivityBehavior.leave(FlowNodeActivityBehavior.java:44) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.bpmn.behavior.FlowNodeActivityBehavior.execute(FlowNodeActivityBehavior.java:36) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:60) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:631) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:626) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityStart.eventNotificationsCompleted(AtomicOperationActivityStart.java:26) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:631) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:626) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.executeActivity(ExecutionEntity.java:455) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.bpmn.behavior.SubProcessActivityBehavior.execute(SubProcessActivityBehavior.java:51) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:60) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:631) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:626) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerStart.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerStart.java:52) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:631) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:626) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:49) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:631) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:626) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionCreateScope.execute(AtomicOperationTransitionCreateScope.java:49) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:631) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:626) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerTake.execute(AtomicOperationTransitionNotifyListenerTake.java:80) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:631) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:626) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionDestroyScope.execute(AtomicOperationTransitionDestroyScope.java:116) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:631) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:626) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerEnd.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerEnd.java:35) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:631) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:626) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:49) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:631) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:626) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.take(ExecutionEntity.java:450) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.take(ExecutionEntity.java:428) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.bpmn.behavior.BpmnActivityBehavior.performOutgoingBehavior(BpmnActivityBehavior.java:140) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.bpmn.behavior.BpmnActivityBehavior.performDefaultOutgoingBehavior(BpmnActivityBehavior.java:66) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.bpmn.behavior.FlowNodeActivityBehavior.leave(FlowNodeActivityBehavior.java:44) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.bpmn.behavior.FlowNodeActivityBehavior.execute(FlowNodeActivityBehavior.java:36) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:60) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:631) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:626) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.pvm.runtime.AtomicOperationProcessStartInitial.eventNotificationsCompleted(AtomicOperationProcessStartInitial.java:45) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:631) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:626) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.pvm.runtime.AtomicOperationProcessStart.eventNotificationsCompleted(AtomicOperationProcessStart.java:62) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:631) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:626) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.start(ExecutionEntity.java:378) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:111) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:37) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:24) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:57) ~[eAgent-utility.jar:na]
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:37) [eAgent-utility.jar:na]
at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40) [eAgent-utility.jar:na]
at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35) [eAgent-utility.jar:na]
at org.activiti.engine.impl.RuntimeServiceImpl.startProcessInstanceByKey(RuntimeServiceImpl.java:77) [eAgent-utility.jar:na]
at de.cybercon.eagent.utils.bpmngenerator.BpmnGeneratorApp.main(BpmnGeneratorApp.java:81) [eAgent-utility.jar:na]
12:00:11.247 [main] DEBUG o.a.e.i.c.s.StandaloneMybatisTransactionContext - firing event rolling back…
12:00:11.247 [main] DEBUG o.a.e.i.c.s.StandaloneMybatisTransactionContext - rolling back ibatis sql session…
12:00:11.247 [main] DEBUG o.a.e.i.c.s.StandaloneMybatisTransactionContext - firing event rolled back…
12:00:11.247 [main] DEBUG o.a.i.t.jdbc.JdbcTransaction - Resetting autocommit to true on JDBC Connection [conn0: url=jdbc:h2:mem:activiti user=SA]
12:00:11.248 [main] DEBUG o.a.i.t.jdbc.JdbcTransaction - Closing JDBC Connection [conn0: url=jdbc:h2:mem:activiti user=SA]
12:00:11.248 [main] DEBUG o.a.i.d.pooled.PooledDataSource - Returned connection 783191662 to pool.
</code>

kayj
Champ in-the-making
Champ in-the-making
Added missing error stack trace

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi KayJ,

Are the libs in the class path?

Regards
Martin

kayj
Champ in-the-making
Champ in-the-making
The classpath contains the jar file, which contains the following groovy libs:
  • groovy
  •  
  • groovyjarjarantlr
  •  
  • groovyjarjarsm
  •  
  • groovyjarjarcommonscli

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

can you check what kind of engines are registered, when you put breakpoint on

at org.activiti.engine.impl.scripting.ScriptingEngines.getEngineByName(ScriptingEngines.java:124)

Regards
Martin

kayj
Champ in-the-making
Champ in-the-making
Line 124 was a different method. I put a breakpoint in the beginning of <code>get EngineByName</code>.

These are the values of some of the member vars:

<code>engineSpis: size 2: JuelScriptEngineFactory + NashornEngineFactory
cachedScriptingEngines: true
cachedEngines: size 0</code>

martin_grofcik
Confirmed Champ
Confirmed Champ
Does

scriptEngineManager.getEngineByName(language)

return engine for the groovy language?

If not groovy is not registered ->  try to find error there.
(There are jUnit test in activiti source which uses groovy engine - try to run them and compare the execution)

Regards
Martin

kayj
Champ in-the-making
Champ in-the-making
Thanks for the answer!

The code returns before reaching the line you mentioned. It returns at <code>scriptEngine = (ScriptEngine)this.cachedEngines.get(language);</code>. The <code>scriptEngine</code> is <code>NULL</code>

Could you be more precise about which test I should run?
I doubt that running the Unit tests will help me finding a solution, since the issue only occurs when executing the jar file. Running the code in IntelliJ works fine.

I'm also working with another project, which uses the same Activiti version and Groovy scripts. Running the jar doesn't cause any problems. So I don't get why this issue occurs at all. I already compared the assembly files and all the dependencies…

martin_grofcik
Confirmed Champ
Confirmed Champ
Could you be more precise about which test I should run?

org.activiti.examples.groovy.GroovyScriptTest

Regards
Martin