Closed qa137 closed 7 months ago
Hello, thank you for submitting your issue. Kindly provide us with a reproducer to help us investigate your issue.
@medoussboug Thank you very much for your reply and I apologize for my late reply.
I found that graaljs dependencies depend on conflicts with other dependencies, resulting in compilation failure in the last step, please try through demo.
Code sample:https://github.com/qa137/demo.git
Hi @qa137, thanks for raising this. Your app is using Graal.js, a Truffle language, and a relatively new Spring Boot, with virtual threads support, and that is unfortunately not supported at the moment. I was able to build your app with a GraalVM built from master and you could try a dev build in the meantime. Nonetheless, I'll look into what we can do to make this work on JDK 21.
Hi @fniephaus The dev build seems to be too old. I can't build the program. I am trying to build GraalVM-Master with the latest labs-openjdk-21 failed. How did you build GraalVM, thank you very much!
Error: Module jdk.graal.compiler does not read a module that exports jdk.vm.ci.services
Building graalvm-jimage: Failed due to error: 1
Build Code
https://github.com/oracle/graal/tree/master
https://github.com/graalvm/labs-openjdk-21/releases/tag/jvmci-23.1-b30
https://github.com/graalvm/mx/releases/tag/7.7.3
You can try this particular dev build.
I have also merged a fix for JDK 21, which will ship with the next patch update (JDK 21.0.3).
@fniephaus Hi,I'm trying to use dev build and I'm still getting an error
Error: Feature com.oracle.truffle.runtime.enterprise.EnableEnterpriseFeature class not found on the classpath. Ensure that the name is correct and that the class is on the classpath.
com.oracle.svm.core.util.UserError$UserException: Feature com.oracle.truffle.runtime.enterprise.EnableEnterpriseFeature class not found on the classpath. Ensure that the name is correct and that the class is on the classpath.
at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.UserError.abort(UserError.java:82)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.FeatureHandler.registerFeatures(FeatureHandler.java:185)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.setupNativeImage(NativeImageGenerator.java:915)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:569)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:537)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:526)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:701)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.start(NativeImageGeneratorRunner.java:140)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:95)
Suppressed: com.oracle.svm.core.util.VMError$HostedError: InternalFeature defined by com.oracle.svm.truffle.TruffleBaseFeature unexpectedly failed with a(n) java.lang.NoSuchMethodError
at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.VMError.shouldNotReachHere(VMError.java:86)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.FeatureHandler.handleFeatureError(FeatureHandler.java:289)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.FeatureHandler.forEachFeature(FeatureHandler.java:94)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.lambda$doRun$2(NativeImageGenerator.java:568)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:567)
... 5 more
Caused by: java.lang.NoSuchMethodError: 'void sun.misc.Unsafe.ensureClassInitialized(java.lang.Class)'
at org.graalvm.truffle/com.oracle.truffle.api.library.LibraryFactory.ensureLibraryInitialized(LibraryFactory.java:385)
at org.graalvm.truffle/com.oracle.truffle.api.library.LibraryFactory.getUncached(LibraryFactory.java:365)
at org.graalvm.truffle/com.oracle.truffle.api.library.LibraryFactory.<init>(LibraryFactory.java:211)
at org.graalvm.truffle/com.oracle.truffle.api.interop.InteropLibraryGen.<init>(InteropLibraryGen.java:178)
at org.graalvm.truffle/com.oracle.truffle.api.interop.InteropLibraryGen.<clinit>(InteropLibraryGen.java:169)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:529)
at java.base/java.lang.Class.forName(Class.java:508)
at org.graalvm.truffle/com.oracle.truffle.api.library.LibraryFactory.loadGeneratedClass(LibraryFactory.java:799)
at org.graalvm.truffle/com.oracle.truffle.api.library.LibraryFactory.resolveImpl(LibraryFactory.java:748)
at org.graalvm.truffle/com.oracle.truffle.api.library.LibraryFactory.resolve(LibraryFactory.java:741)
at org.graalvm.truffle/com.oracle.truffle.api.interop.InteropLibrary.<clinit>(InteropLibrary.java:2941)
at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotValueDispatch.<clinit>(PolyglotValueDispatch.java:167)
at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotImpl.initialize(PolyglotImpl.java:199)
at org.graalvm.polyglot/org.graalvm.polyglot.Engine.loadAndValidateProviders(Engine.java:1686)
at org.graalvm.polyglot/org.graalvm.polyglot.Engine$1.run(Engine.java:1712)
at org.graalvm.polyglot/org.graalvm.polyglot.Engine$1.run(Engine.java:1707)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:319)
at org.graalvm.polyglot/org.graalvm.polyglot.Engine.initEngineImpl(Engine.java:1707)
at org.graalvm.polyglot/org.graalvm.polyglot.Engine$ImplHolder.<clinit>(Engine.java:190)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:413)
at java.base/java.lang.Class.forName(Class.java:404)
at org.graalvm.truffle.runtime.svm/com.oracle.svm.truffle.TruffleBaseFeature.invokeStaticMethod(TruffleBaseFeature.java:276)
at org.graalvm.truffle.runtime.svm/com.oracle.svm.truffle.TruffleBaseFeature.cleanup(TruffleBaseFeature.java:419)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.FeatureHandler.forEachFeature(FeatureHandler.java:92)
... 7 more
My project is currently stuck here. May I ask when version 21.0.3 is expected to be released? Or you can provide the appropriate jdk or graalvm version, I will compile it myself, thank you very much!
Hi @qa137,
It seems you have gotten past the initial error that you have reported, great!
The new error message suggest you are trying to build a project that makes use of a Truffle language and you include the truffle-enterprise
module, but you build with a GraalVM Community Edition.
You can either try and remove the truffle-enterprise
module (e.g., see here) or wait for Oracle GraalVM for JDK 21.0.3, which will be available April 16, 2024.
Hope this helps!
-- Fabio
Hi @fniephaus When I tried to remove truffle-enterprise, I still got an exception saying that the compilation failed. I don't know how to solve it, please help me, thank you very much
Error log svm_err_b_20240205T222854.207_pid210.md
Hey @qa137, I see this in the error report:
Caused by: java.lang.IllegalStateException: Polyglot version compatibility check failed. Your Java runtime '22+27-jvmci-b01' with native-image feature version '24.0.0' is incompatible with polyglot version '23.1.2'. Update the org.graalvm.polyglot versions to at least '24.0.0' to resolve this. To disable this version check the '-Dpolyglotimpl.DisableVersionChecks=true' system property can be used. It is not recommended to disable version checks.
The error should actually be a user error, and I'm fixing that in #8317. We are investigating why the check fails because 23.1.2 is supposed to be compatible with 24.0.0. In the meantime, you could try disabling the check as the error suggests.
Hope this helps!
Hi @fniephaus
I try to add - Dpolyglotimpl. DisableVersionChecks = true
, but there will be usererror. Can you provide another dev-builds, I will test it here, thank you very much
Oh right, the charms of being an early adopter. Thanks for still trying to get this to work. So you either need 21.0.3, which is not yet available, or a dev build. You can't, however, build a language of version 23.1.2 with the dev build, because it's polyglot version is 24.0.0 and languages are unfortunately not forward compatible. What you can do instead, however, is using the snapshot build of the language, which is included in the maven-resource-bundle-community-dev.tar.gz
such as this one. After downloading and extracting, you should be able to use that as your local maven repo (e.g., via MAVEN_OPTS="${MAVEN_OPTS} -Dmaven.repo.local=/path/to/extracted/maven-resource-bundle"
). Don't forget to also update the versions in your pom.xml
from 23.1.2 to 24.0.0-SNAPSHOT
. Let me know how it goes!
Hi @fniephaus I failed to compile native implementation using Graalvm-community-OpenJDK-22+27.1, but I succeeded using the latest version of graalvm (Graalvm-community-OpenJDK-23+8.1), thank you very much for your help!
You are welcome! Glad it's working for you now.
I tried to test building binary (native image) for hello.py using graalpy -v -m standalone native --module hello.py --output hello.exe
. But it failed with the following errors.
I noticed the main error seems like Error: Feature com.oracle.truffle.runtime.enterprise.EnableEnterpriseFeature class not found on the classpath. Ensure that the name is correct and that the class is on the classpath.
.
Hi @liudonghua123 , thank you for sharing your issue with us. Please create a new ticket for your issue following the same template and we will be happy to help you out.
I tried to test building binary (native image) for hello.py using
graalpy -v -m standalone native --module hello.py --output hello.exe
. But it failed with the following errors.I noticed the main error seems like
Error: Feature com.oracle.truffle.runtime.enterprise.EnableEnterpriseFeature class not found on the classpath. Ensure that the name is correct and that the class is on the classpath.
.Details
I tried graalvm ee version (graalvm-jdk-21.0.3+7.1), then this error disappeared, but the binary size is very big and the simple hello.exe run with 16.406s.
Describe the issue Compilation execution fails at the last step
Describe GraalVM and your environment:
Steps to reproduce the issue run steps:
mvn -Pnative clean native:compile
More details