GraalVM + GraalJS and Wildfly 36

32 views
Skip to first unread message

Maycon Fábio de Oliveira

unread,
Jun 25, 2025, 1:23:30 PM6/25/25
to WildFly
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.jar



However, I'm still getting the following error when running in WildFly:


java.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?

Maycon Fábio de Oliveira

unread,
Jun 25, 2025, 4:16:34 PM6/25/25
to WildFly
Just complementing the error:

17:15:18,337 INFO [stdout] (default task-1) [class-path-isolation] Start polyglot class-path isolation

17:15:18,337 INFO [stdout] (default task-1) [class-path-isolation] Collected 1 class-path entries from java.class.path system property

17:15:18,337 INFO [stdout] (default task-1) [class-path-isolation] Class-path entry: /servers/wildfly-36.0.1.Final/jboss-modules.jar

17:15:18,339 INFO [stdout] (default task-1) [class-path-isolation] No truffle-api and/or polyglot found on classpath.


Reply all
Reply to author
Forward
0 new messages