Hi again!
I'm migrating from WildFly 20 to 36 and from Java 11 to 21, and now I'm facing issues with Graal.js.
Previously, I was able to use Graal.js simply with the following module in WildFly:
<module xmlns="urn:jboss:module:1.3" name="org.graalvm">
<properties>
<property name="jboss.api" value="public"/>
</properties>
<dependencies>
<system export="true">
<paths>
<path name="org/graalvm/polyglot"/>
</paths>
</system>
</dependencies>
</module>Now, since Graal.js is no longer bundled with the JVM, I’ve added the following JARs to WEB-INF/lib:
collections-23.1.1.jar
icu4j-23.1.1.jar
jniutils-23.1.1.jar
js-language-23.1.1.jar
js-scriptengine-23.1.1.jar
nativeimage-23.1.1.jar
polyglot-23.1.1.jar
regex-23.1.1.jar
truffle-api-23.1.1.jar
truffle-compiler-23.1.1.jar
truffle-runtime-23.1.1.jar
word-23.1.1.jarHowever, I'm still getting the following error when running in WildFly:
j
ava.lang.IllegalStateException: No language and polyglot implementation was found on the class-path.
Make sure at least one language is added on the class-path.
If you put a language on the class-path and you encounter this error, then there could be a problem with isolated class loading.
Use -Dpolyglotimpl.TraceClassPathIsolation=true to debug class loader isolation problems.
For best performance it is recommended to use polyglot from the module-path instead of the class-path.
at org.graalvm.polyglot.Engine$PolyglotInvalid.noPolyglotImplementationFound(Engine.java:2071)
at org.graalvm.polyglot.Engine$PolyglotInvalid.createHostAccess(Engine.java:2057)
at org.graalvm.polyglot.Engine$PolyglotInvalid.createHostAccess(Engine.java:2023)
The strange part is that the same code works fine when executed from a standalone main() class outside of WildFly.Question:
What do I need to add or configure in the JBoss modules so that WildFly can correctly load Graal.js and avoid the classloader isolation issue?