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

Quarkus >=1.1.0.Final breaks GraalVM Polyglot #7145

Closed
alex-lmco opened this issue Feb 11, 2020 · 10 comments
Closed

Quarkus >=1.1.0.Final breaks GraalVM Polyglot #7145

alex-lmco opened this issue Feb 11, 2020 · 10 comments
Assignees
Labels
kind/question Further information is requested

Comments

@alex-lmco
Copy link

Describe the bug
Quarkus version >= 1.1.0.Final breaks GraalVM Polyglot. On 1.1.0.CR1 polyglot works as expected. Past 1.1.0.CR1 there is a classpath error related to finding the ScriptEngine.

Expected behavior

Able to initialize a script context

Actual behavior

Unable to initialize a script context:

TestRunnerTest > test() FAILED
java.lang.NoClassDefFoundError: Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
at org.graalvm.polyglot.Engine.getImpl(Engine.java:263)
at org.graalvm.polyglot.Engine$Builder.build(Engine.java:501)
at org.graalvm.polyglot.Context$Builder.build(Context.java:1406)
at org.graalvm.polyglot.Context.create(Context.java:700)
at org.example.TestRunner.run(TestRunner.java:8)
at org.example.TestRunnerTest.test(TestRunnerTest.java:10)

To Reproduce
Steps to reproduce the behavior:

./gradlew test in the minimal example project

Configuration

Screenshots

Environment (please complete the following information):

Additional context
test.zip

@alex-lmco alex-lmco added the kind/bug Something isn't working label Feb 11, 2020
@gwenneg gwenneg self-assigned this Feb 11, 2020
@gwenneg
Copy link
Member

gwenneg commented Feb 11, 2020

Hi @alex-lmco and thanks for reporting this issue.

It could be a consequence of the GraalVM downgrade we had to make between Quarkus 1.1.0.CR1 and 1.1.0.Final because of a GraalVM 19.3.0 blocking issue (oracle/graal#1984):

Quarkus release GraalVM supported version(s)
1.1.0.CR1 19.3.0
1.1.0.Final 19.2.1
1.2.0..Final 19.2.1 (default) and 19.3.1
1.3.0.Alpha1 19.3.1

I'll give your reproducer a try with Quarkus 1.3.0.Alpha1 and see if it's still broken.

@gwenneg
Copy link
Member

gwenneg commented Feb 11, 2020

I just ran ./gradlew test using your test project without any change and a local GraalVM CE 19.3.1 (Java 8 edition) installation. The test completed successfully so I suppose the Polyglot error you experienced came from a GraalVM 19.2.1 issue.

Could you please do the same test and confirm me everything's OK?

@alex-lmco
Copy link
Author

FYI this is on windows:

GraalVM 19.3.1 + Quarkus 1.2.0.Final, JDK 11:

$ java -version
openjdk version "11.0.6" 2020-01-14
OpenJDK Runtime Environment GraalVM CE 19.3.1 (build 11.0.6+9-jvmci-19.3-b07)
OpenJDK 64-Bit Server VM GraalVM CE 19.3.1 (build 11.0.6+9-jvmci-19.3-b07, mixed mode, sharing)
$ ./gradlew test

> Task :test

TestRunnerTest > test() FAILED
    java.lang.NoClassDefFoundError at TestRunnerTest.java:10

GraalVM 19.3.1 + Quarkus 1.2.0.Final, JDK 8:

$ java -version
openjdk version "1.8.0_242"
OpenJDK Runtime Environment (build 1.8.0_242-b06)
OpenJDK 64-Bit GraalVM CE 19.3.1 (build 25.242-b06-jvmci-19.3-b07, mixed mode)
$ ./gradlew test

> Task :test

TestRunnerTest > test() FAILED
    java.lang.NoClassDefFoundError at TestRunnerTest.java:10

I can't get master (as of this morning) or 1.3.0.Alpha1 to work due to an issue with quarkusTestConfig:

**Task :quarkusTestConfig FAILED
Caching disabled for task ':quarkusTestConfig' because:
  Build cache is disabled
Task ':quarkusTestConfig' is not up-to-date because:
  Task has not declared any outputs despite executing actions.
:quarkusTestConfig (Thread[Execution worker for ':',5,main]) completed. Took 0.633 secs.**

@gwenneg
Copy link
Member

gwenneg commented Feb 12, 2020

I don't have a Windows machine with GraalVM right now, but I'll try to run a Windows test and see if there's any difference on my side.

@gwenneg
Copy link
Member

gwenneg commented Feb 12, 2020

I double-checked on the MacBook I used for the test yesterday, it is definitely working fine:

gwenneg-2:test Gwenneg$ java -version
openjdk version "1.8.0_242"
OpenJDK Runtime Environment (build 1.8.0_242-b06)
OpenJDK 64-Bit GraalVM CE 19.3.1 (build 25.242-b06-jvmci-19.3-b07, mixed mode)

gwenneg-2:test Gwenneg$ ./gradlew test -i --rerun-tasks
[...]
> Task :test
Caching disabled for task ':test' because:
  Build cache is disabled
Task ':test' is not up-to-date because:
  Executed with '--rerun-tasks'.
Starting process 'Gradle Test Executor 4'. Working directory: /Users/Gwenneg/git/test Command: /Library/Java/JavaVirtualMachines/graalvm-ce-java8-19.3.1/Contents/Home/bin/java -Djava.security.manager=worker.org.gradle.process.internal.worker.child.BootstrapSecurityManager -Dnative.image.path=/Users/Gwenneg/git/test/build/test-unspecified-runner -Dorg.gradle.native=false -Dquarkus-deployment-cp -Xmx512m -Dfile.encoding=UTF-8 -Duser.country=FR -Duser.language=en -Duser.variant -ea -cp /Users/Gwenneg/.gradle/caches/6.1.1/workerMain/gradle-worker.jar worker.org.gradle.process.internal.worker.GradleWorkerMain 'Gradle Test Executor 4'
Successfully started process 'Gradle Test Executor 4'

TestRunnerTest STANDARD_ERROR
    Feb 12, 2020 6:26:38 PM org.jboss.threads.Version <clinit>
    INFO: JBoss Threads version 3.0.0.Final
    Feb 12, 2020 6:26:39 PM io.quarkus.runtime.Timing printStartupTime
    INFO: Quarkus 1.2.0.Final started in 0.157s. 
    Feb 12, 2020 6:26:39 PM io.quarkus.runtime.Timing printStartupTime
    INFO: Profile test activated. 
    Feb 12, 2020 6:26:39 PM io.quarkus.runtime.Timing printStartupTime
    INFO: Installed features: []

Gradle Test Executor 4 STANDARD_ERROR
    Feb 12, 2020 6:26:39 PM io.quarkus.runtime.Timing printStopTime
    INFO: Quarkus stopped in 0.000s

Gradle Test Executor 4 finished executing tests.

> Task :test
Finished generating test XML results (0.004 secs) into: /Users/Gwenneg/git/test/build/test-results/test
Generating HTML test report...
Finished generating test html results (0.009 secs) into: /Users/Gwenneg/git/test/build/reports/tests/test
:test (Thread[Execution worker for ':',5,main]) completed. Took 5.118 secs.

BUILD SUCCESSFUL in 8s

I also ran the same test using Windows + GraalVM CE 19.3.1 (JDK 8 edition) and it failed, so I can confirm there's an issue and it seems to only affect Windows.

@gwenneg
Copy link
Member

gwenneg commented Feb 12, 2020

Here's another problem: I don't know how I made it fail on Windows, now I can't reproduce the failure anymore...

@alex-lmco
Copy link
Author

I can consistently reproduce it on windows by just running ./gradlew test. Unfortunately I cannot not reproduce it which would be helpful for development since we run our binaries containerized on linux but do our development on windows.

@gwenneg
Copy link
Member

gwenneg commented Feb 14, 2020

Well, I'm really sorry but I tried multiple times with each GraalVM version and couldn't reproduce the failure.

Here's what I did, each time with an unmodified test.zip:

$ export GRAALVM_HOME="C:\Program Files\Java\graalvm-ce-19.2.1"
$ export JAVA_HOME=$GRAALVM_HOME
$ export PATH=$JAVA_HOME/bin:$PATH
$ java -version
openjdk version "1.8.0_232"
OpenJDK Runtime Environment (build 1.8.0_232-20191009144847.buildslave.jdk8u-src-tar--b07)
OpenJDK 64-Bit GraalVM CE 19.2.1 (build 25.232-b07-jvmci-19.2-b03, mixed mode)
$ ./gradlew clean test --rerun-tasks --refresh-dependencies
BUILD SUCCESSFUL in 47s
$ export GRAALVM_HOME="C:\Program Files\Java\graalvm-ce-java8-19.3.1"
$ export JAVA_HOME=$GRAALVM_HOME
$ export PATH=$JAVA_HOME/bin:$PATH
$ java -version
openjdk version "1.8.0_242"
OpenJDK Runtime Environment (build 1.8.0_242-b06)
OpenJDK 64-Bit GraalVM CE 19.3.1 (build 25.242-b06-jvmci-19.3-b07, mixed mode)
$ ./gradlew clean test --rerun-tasks --refresh-dependencies
BUILD SUCCESSFUL in 57s
$ export GRAALVM_HOME="C:\Program Files\Java\graalvm-ce-java11-19.3.1"
$ export JAVA_HOME=$GRAALVM_HOME
$ export PATH=$JAVA_HOME/bin:$PATH
$ java -version
openjdk version "11.0.6" 2020-01-14
OpenJDK Runtime Environment GraalVM CE 19.3.1 (build 11.0.6+9-jvmci-19.3-b07)
OpenJDK 64-Bit Server VM GraalVM CE 19.3.1 (build 11.0.6+9-jvmci-19.3-b07, mixed mode, sharing)
$ ./gradlew clean test --rerun-tasks --refresh-dependencies
BUILD SUCCESSFUL in 1m 1s

Either I'm missing something obvious here or the failure I saw was a false positive.

@gsmet: Would you have a suggestion of someone who could help testing this on Windows?

@alex-lmco
Copy link
Author

Thank you for the inclusion of the "refresh-dependencies" part. I apparently had a couple bad jars in my local maven repo. When I cleared out ~/.m2 everything went away and both graalvm jdk11 and graalvm jdk8 work just fine. Thank you!

@gsmet gsmet added kind/question Further information is requested and removed kind/bug Something isn't working labels Feb 17, 2020
@gwenneg
Copy link
Member

gwenneg commented Feb 17, 2020

You're welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants