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

Java 21: GraalJSEngineFactory could not be instantiated #280

Closed
xavierba opened this issue Apr 17, 2024 · 4 comments · Fixed by #304 · May be fixed by #292
Closed

Java 21: GraalJSEngineFactory could not be instantiated #280

xavierba opened this issue Apr 17, 2024 · 4 comments · Fixed by #304 · May be fixed by #292
Assignees
Milestone

Comments

@xavierba
Copy link
Contributor

CI fails when using Java 21 with the following error:

ScriptEngineManager providers.next(): javax.script.ScriptEngineFactory: Provider com.oracle.truffle.js.scriptengine.GraalJSEngineFactory could not be instantiated
ScriptEngineManager providers.next(): javax.script.ScriptEngineFactory: Provider com.oracle.truffle.js.scriptengine.GraalJSEngineFactory could not be instantiated
Error:  Tests run: 3, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.645 s <<< FAILURE! - in org.lsc.beans.syncoptions.PropertiesBasedSyncOptionsTest
Error:  org.lsc.beans.syncoptions.PropertiesBasedSyncOptionsTest.testJS  Time elapsed: 0.606 s  <<< ERROR!
java.lang.NullPointerException: Cannot invoke "org.lsc.utils.ScriptableEvaluator.evalToObjectList(org.lsc.Task, String, java.util.Map)" because "se" is null
	at org.lsc.utils.ScriptingEvaluator.evalToObjectList(ScriptingEvaluator.java:159)
	at org.lsc.beans.syncoptions.PropertiesBasedSyncOptionsTest.testJS(PropertiesBasedSyncOptionsTest.java:164)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:377)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:284)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:248)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:167)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:456)
	at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:169)
	at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:595)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:581)

See https://github.com/lsc-project/lsc/actions/runs/8688835816/job/23825324318#step:10:155

@coudot coudot added the bug label May 28, 2024
@coudot coudot added this to the 2.2 milestone May 28, 2024
@artlog
Copy link
Contributor

artlog commented Jun 3, 2024

taking a look

@artlog
Copy link
Contributor

artlog commented Jun 3, 2024

This error happen on Adoptium (Temurin), or with debian or ubuntu openjdk packages
It does not happen on RedHat or Fedora where a openjdk or derivative is provided.
In any case a NullPointerException is never acceptable.

artlog pushed a commit to Worteks/lsc that referenced this issue Jun 4, 2024
- avoid NullPointerException
- always default to a non null defaut scripting implementation
  - default to ErrorMissingScriptEvalauator to fail a first unsupported scripting usage
- try to uee rhino if no js is
artlog pushed a commit to Worteks/lsc that referenced this issue Jun 4, 2024
- avoid NullPointerException
- always default to a non null defaut scripting implementation
  - default to ErrorMissingScriptEvalauator to fail a first unsupported scripting usage
- try to uee rhino if no js is
artlog pushed a commit to Worteks/lsc that referenced this issue Jun 4, 2024
   - avoid NullPointerException even if rhino and js are missing
@coudot
Copy link
Member

coudot commented Aug 27, 2024

@artlog hello, could you create a PR with your changes?

@abpai94
Copy link
Collaborator

abpai94 commented Aug 27, 2024

I think this might be the PR: #292

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants