Closed oleksiylukin closed 4 years ago
Hello @oleksiylukin, Is this a Maven project? What does the pom.xml dependencies look like?
Can you share the full reproducer?
Just got the same error:
MacOS 10.15.3
@hotleave can you also share a reproducer? Thanks
@hotleave can you also share a reproducer? Thanks
Here is the demo: https://github.com/hotleave/code-with-quarkus
MacOS 10.15.3 GraalVM jdk8 20.0
run mvn quarkus:dev
to start the project and visit: http://localhost:8080/hello
In ExampleResourceTest
, just call the method directly, it works fine.
FYI
Update:
build the artifact build with mvn package
, and run with java -jar target/xxxx-runner.jar
works fine
Even though QuarkusClassLoader delegates to the system class loader and the system class loader can load it fine, there is a check in service loader now that will ignore classes from named modules. Basically it looks like if the TCCL is anything other than the system CL, or a modular CL that exposes this module I don't know if there is any way to get this to work.
For now you can work around this to some extent by temporarily setting the thread context classloader to ClassLoader.getSystemClassLoader().
Basically it looks like if the TCCL is anything other than the system CL, or a modular CL
I haven't checked the code yet, but all this is in JDK8? (of course leaving out the modular CL bit)
I was testing on a JDK11 version of Graal.
Project to reproduce bug is here : https://github.com/alukin/polyglot-test-quarkus
It is impossible to build native image also. Th same exception occurs
I have not testes the reproducer but it looks like there some dependencies and set-up missing. Here some set-up I have in a project based on Quarkus 1.3.0.Final that sues JS:
I have not testes the reproducer but it looks like there some dependencies and set-up missing. Here some set-up I have in a project based on Quarkus 1.3.0.Final that sues JS:
build native image with --language:js
arguments works fine
I tried my small reproducer application with 1.3.1-Final and it does not work too as with 1.3.0.Final. I updated reproducer application pom.xml with Quarkus 1.2.1.Final to show that it works with previous 1.2.1.Final fine.
I use GraalVM version is 20.0.0-jdk11 in all cases.
Please see comments in pom.xml how to change version and reproduce this bug https://github.com/alukin/polyglot-test-quarkus
@stuartwdouglas said https://github.com/quarkusio/quarkus/pull/8998 might fix that one.
Hello. I am using quarkus 1.6.0-Final and experiencing this error. I can work around it with the Thread.currentThread().setContextClassLoader(ClassLoader.getSystemClassLoader());
method.
It is still the problem with Quarkus up to version 1.9.0-Final. Please see my reproducer application at https://github.com/alukin/polyglot-test-quarkus
It works when running it from the "runner" jar but does not work in development mode making it impossible to debug. Please, re-open this bug or any other related
@oleksiylukin and @hotleave , just add these lines on your pom.xml inside
\
<dependency>
<groupId>org.graalvm.js</groupId>
<artifactId>js</artifactId>
<version>${graalvm.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.graalvm.js</groupId>
<artifactId>js-scriptengine</artifactId>
<version>${graalvm.version}</version>
</dependency>
working with quarkus platform version 1.9.0.Final and 1.9.2.Final (maybe other older version too)
I use quarkus with polyglot API in my project and it's working also in native build on Windows/Linux/Docker environment
New class loader of Quarkus 1.3.0 can not load polyglot framework of GraalVM, Previous version (1.2.1) works fine.
Expected behavior JavaScript code works when executed inside of REST resource
Actual behavior Throws exception org.jboss.resteasy.spi.UnhandledException: java.lang.IllegalStateException: No language and polyglot implementation was found on the classpath. Make sure the truffle-api.jar is on the classpath.
To Reproduce Create and run following simple resource:
Configuration Simplest possible
Environment Linux alhp.alhome 5.5.9-200.fc31.x86_64 openjdk version "11.0.6" 2020-01-14 OpenJDK Runtime Environment GraalVM CE 20.0.0 (build 11.0.6+9-jvmci-20.0-b02) OpenJDK 64-Bit Server VM GraalVM CE 20.0.0 (build 11.0.6+9-jvmci-20.0-b02, mixed mode, sharing)