Can't find scripting engine for 'javascript': scriptEngine is null: org.camunda.bpm.engine.exception.NullValueException

Hi,
Updated the java version from 11 to 17. While executing worfklfow got the below error. This is working in java11.
We are using camunda 7.18 and we added camunda and its dependency in modules in wildfly server ie in wildfly-26.1.3.Final\modules\org\camunda.

2023-07-24 10:29:14,458 ERROR [org.camunda.bpm.engine.context] (pool-7-thread-2) ENGINE-16004 Exception while closing command context:
Can’t find scripting engine for ‘javascript’: scriptEngine is null: org.camunda.bpm.engine.exception.NullValueException:
2023-07-24 10:29:14,458 ERROR [org.camunda.bpm.engine.context] (pool-7-thread-2) ENGINE-16004 Exception while closing command context:
Can’t find scripting engine for ‘javascript’: scriptEngine is null: org.camunda.bpm.engine.exception.NullValueException: Can’t find scripting engine for ‘javascript’: scriptEngine is null
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
at org.camunda.bpm.camunda-engine@7.18.0//org.camunda.bpm.engine.impl.util.EnsureUtil.generateException(EnsureUtil.java:398)
at org.camunda.bpm.camunda-engine@7.18.0//org.camunda.bpm.engine.impl.util.EnsureUtil.ensureNotNull(EnsureUtil.java:55)
at org.camunda.bpm.camunda-engine@7.18.0//org.camunda.bpm.engine.impl.util.EnsureUtil.ensureNotNull(EnsureUtil.java:50)
at org.camunda.bpm.camunda-engine@7.18.0//org.camunda.bpm.engine.impl.scripting.engine.ScriptingEngines.getGlobalScriptEngine(ScriptingEngines.java:143)
at org.camunda.bpm.camunda-engine@7.18.0//org.camunda.bpm.engine.impl.scripting.engine.ScriptingEngines.getScriptEngineForLanguage(ScriptingEngines.java:117)
at org.camunda.bpm.camunda-engine@7.18.0//org.camunda.bpm.engine.impl.scripting.env.ScriptingEnvironment.execute(ScriptingEnvironment.java:82)
at org.camunda.bpm.camunda-engine@7.18.0//org.camunda.bpm.engine.impl.delegate.ScriptInvocation.invoke(ScriptInvocation.java:47)
at org.camunda.bpm.camunda-engine@7.18.0//org.camunda.bpm.engine.impl.delegate.DelegateInvocation.proceed(DelegateInvocation.java:58)
at org.camunda.bpm.camunda-engine@7.18.0//org.camunda.bpm.engine.impl.delegate.DefaultDelegateInterceptor.handleInvocationInContext(DefaultDelegateInterceptor.java:92)
at org.camunda.bpm.camunda-engine@7.18.0//org.camunda.bpm.engine.impl.delegate.DefaultDelegateInterceptor.handleInvocation(DefaultDelegateInterceptor.java:63)
at org.camunda.bpm.camunda-engine@7.18.0//org.camunda.bpm.engine.impl.bpmn.behavior.ScriptTaskActivityBehavior$1.call(ScriptTaskActivityBehavior.java:55)
at org.camunda.bpm.camunda-engine@7.18.0//org.camunda.bpm.engine.impl.bpmn.behavior.ScriptTaskActivityBehavior$1.call(ScriptTaskActivityBehavior.java:51)
at org.camunda.bpm.camunda-engine@7.18.0//org.camunda.bpm.engine.impl.bpmn.behavior.AbstractBpmnActivityBehavior.executeWithErrorPropagation(AbstractBpmnActivityBehavior.java:90)
at org.camunda.bpm.camunda-engine@7.18.0//org.camunda.bpm.engine.impl.bpmn.behavior.ScriptTaskActivityBehavior.performExecution(ScriptTaskActivityBehavior.java:51)
at org.camunda.bp

Added these dependencies

js-23.0.1.jar, js-scriptengine-23.0.1.jar, groovy-jsr223-4.0.13.jar, rhino-engine-1.7.14.jar, nashorn-core-15.4.jar.

also but no luck .

Any help on this is highly appreciated.
Thank you.

Hi @pbaddi jdk-17 doesn’t support javaScript anymore so better to migrate all scripting task to groovy to solve your problems.

TIA

Hi @yadav1990 ,

Thank you your inputs.

Customers wont accept this change from javascript to groovy. How to migrate existing script nodes? What all alternative we have if we dont want to go groovy?

Thanks,
Poornima

Hi,

Please check our docs on this topic: Update from 7.15 to 7.16 | docs.camunda.org

Cheers,
Thorben

Hi @thorben ,
Thank you for you inputs.
I tried adding nashorn-core-15.4.jar in the classpath. (as part of 1. Reintegrate the Nashorn JavaScript engine with the OpenJDK Nashorn Engine) but I got same error.

Regards,
Poornima

As you seem to be using shared engine on Wildfly: make sure the script engine classes are accessible to the camunda-engine module (e.g. by setting proper module imports). For reference, you can have a look at the default Camunda Wildfly distribution (e.g. in version 7.19) that configures GraalJS out of the box.

Cheers,
Thorben

Hi,
try to add graalvm.js dependency and see.

TIA.