Connector example NullValueException: Can't find scripting engine for 'javascript'

Hello,

i need some help getting the connector example running in eclipse. I installed Eclipse with maven as described in the user-guide. When i run maven-install on a new project like shown in the video tutorial “Camunda Tutorial for Java Developers”, i get the successfull output. The bpm process engine version 7.14 is also running fine. Im using JRE 1.8.0_271 and the JDK version 15.0.1.
But now i want to check out how to use a custom connector trying to adopt the example from the git camunda-bpm-examples/tree/master/servicetask/rest-service project.
When i try to maven-install the unchanged example i got the error:

ERROR org.camunda.bpm.engine.context - 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

there is a similar post here using IntelliJ but i’m using a fresh Eclipse installation with maven.
I tried using several other dependencies like graalvm which is mentioned here: https://jira.camunda.com/browse/CAM-12103
But whith graalvm i got another error:

ENGINE-16004 Exception while closing command context: Unable to evaluate script:org.graalvm.polyglot.PolyglotException: ReferenceError: org is not defined
org.camunda.bpm.engine.ScriptEvaluationException: Unable to evaluate script:org.graalvm.polyglot.PolyglotException: ReferenceError: org is not defined

so im in the dark here and dont know how to continue, although it is maybe an easy task for a Java-developer. I appreciate any help - for me an old .NET Developer Java(script) is a jungle :wink:

Kind regards, J.Lucia

1 Like

This is your problem - in JDK 15 the javascript engine has been removed. Camunda useses the Javascript engine within the JDK when running any javascript so you’re going to need to use an older version of the Java JDK

Thank you Niall for your quick response! After installing JDK 14 and adding it to the Installed JREs in Eclipse the build process succeeded.
Kind regards J.Lucia

1 Like

Are there any plans to move to support GraalVM? Sounds like their Javascript support is cutting edge and performant. It would also be interesting to see Camunda scripts support the other languages supported by GraalVM, Python in particular … though I confess I know nothing about Jython vs Python.

While I expect the performance optimizations of GraalVM won’t be material to us, we are very worried about the Nashorn deprecation. Also, we are largely a Typescript shop which, I believe would be fully supported by GraalVM.js because of its focus on the latest versions of ECMAScript.

Hi @Stephen_Newport
We’ll very likely release some kind of replacement for Nashorn. I’d say that GraalVM is currently the most likely option, but we’re still looking into exactly what the best option is.

Hello Niall do you have any news about this? In our company we have others decision engine with several rules writed in javascript. A possibility would be move these to camunda decision engine if this support javascript in GraalVM or the last JDK.

You can follow this ticket for information on the progress.
Looks like it could be supported in the 7.16 release which will be out in October.
https://jira.camunda.com/browse/CAM-13518

I am using Camunda 7.19 and JDK11 and want to switch to JDK17 and have the same problem with Javascript in DMN.
The Camunda Homepage lists under Supported Environments that JDK17 is supported!
So I added dependency to GraalVM as shown in https://forum.camunda.io/t/cant-find-scripting-engine-for-javascript-scriptengine-is-null-camunda-with-spring-boot-microservices/23282/7


        <dependency>
            <groupId>org.graalvm.js</groupId>
            <artifactId>js</artifactId>
            <version>23.0.2</version>
        </dependency>
        <dependency>
            <groupId>org.graalvm.js</groupId>
            <artifactId>js-scriptengine</artifactId>
            <version>23.0.2</version>
        </dependency>

With GraalVM DMN seems to work but following is written to stderr:


stderr: [To redirect Truffle log output to a file use one of the following options:
stderr: * '--log.file=<path>' if the option is passed using a guest language launcher.
stderr: * '-Dpolyglot.log.file=<path>' if the option is passed using the host Java launcher.
stderr: * Configure logging using the polyglot embedding API.]
stderr: [engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation.
stderr: The guest application code will therefore be executed in interpreted mode only.
stderr: Execution only in interpreted mode will strongly impact the guest application performance.
stderr: For more information on using GraalVM see https://www.graalvm.org/java/quickstart/.
stderr: To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property.
stderr: [engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation.
stderr: The guest application code will therefore be executed in interpreted mode only.
stderr: Execution only in interpreted mode will strongly impact the guest application performance.
stderr: For more information on using GraalVM see https://www.graalvm.org/java/quickstart/.
stderr: To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property.
stderr: [engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation.
stderr: The guest application code will therefore be executed in interpreted mode only.
stderr: Execution only in interpreted mode will strongly impact the guest application performance.
stderr: For more information on using GraalVM see https://www.graalvm.org/java/quickstart/.
stderr: To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property.

Can I ignore this messages?

Hi @raho - the logs provided don’t look related. Can you open a new topic with your questions?