Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 302: Switch from Nashorn to GraalVM for Javascript execution. #221

Merged
merged 2 commits into from
Oct 19, 2023

Conversation

kaladay
Copy link

@kaladay kaladay commented Oct 18, 2023

resolves TAMULib/fw-registry#302

In addition to information provided on the issue, this dependency is also required:

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

The configuration file appears to be case sensitive.
Use Graal.js with an upper case G rather than a lower case g.

The following warning is observed:

[engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation.
The guest application code will therefore be executed in interpreted mode only.
Execution only in interpreted mode will strongly impact the guest application performance.
For more information on using GraalVM see https://www.graalvm.org/java/quickstart/.
To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property.
[engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation.
The guest application code will therefore be executed in interpreted mode only.
Execution only in interpreted mode will strongly impact the guest application performance.
For more information on using GraalVM see https://www.graalvm.org/java/quickstart/.
To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property.

When JS processing errors happen, this gets shown:

Execution of JMS message listener failed, and no ErrorHandler has been set.

see: https://forum.camunda.io/t/console-filling-with-graalvm-warnings-when-using-in-process-scripting/31812/2
see: https://docs.camunda.org/manual/7.19/user-guide/process-engine/scripting/#custom-scriptengineresolver

Instructions provided by issue are applied as-is with no observed problems.
This dependency is also required:
```
    <dependency>
      <groupId>org.graalvm.js</groupId>
      <artifactId>js-scriptengine</artifactId>
      <version>22.3.3</version>
    </dependency>
```

The following arning is observed:
```
[engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation.
The guest application code will therefore be executed in interpreted mode only.
Execution only in interpreted mode will strongly impact the guest application performance.
For more information on using GraalVM see https://www.graalvm.org/java/quickstart/.
To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property.
[engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation.
The guest application code will therefore be executed in interpreted mode only.
Execution only in interpreted mode will strongly impact the guest application performance.
For more information on using GraalVM see https://www.graalvm.org/java/quickstart/.
To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property.
```

The configuration file appears to be case sensitive.
Use `Graal.js` with an upper case `G` rather than a lower case `g`.
@kaladay kaladay merged commit f206b2d into staging Oct 19, 2023
@kaladay kaladay deleted the 302-nashorn_to_graalvm branch October 19, 2023 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants