oracle / graal

GraalVM compiles Java applications into native executables that start instantly, scale fast, and use fewer compute resources 🚀
https://www.graalvm.org
Other
20.4k stars 1.64k forks source link

Caused by: java.lang.NoSuchMethodError: 'jdk.vm.ci.meta.ResolvedJavaMethod[] jdk.vm.ci.meta.ResolvedJavaType.getDeclaredMethods(boolean)' #10036

Open shuowang97 opened 1 week ago

shuowang97 commented 1 week ago

Describe the issue We try to use GraalVM Context in our project to execute JS script, but we're getting this method not found exception

Steps to reproduce the issue mvn clean install

Describe GraalVM and your environment:

More details Add any other information about the problem here. Especially important are stack traces or log output. Feel free to link to gists or to screenshots if necessary. The project is working fine in my local, but while running in the cloud(Linux OS), they we get the exceptions.

Caused by: java.lang.NoSuchMethodError: 'jdk.vm.ci.meta.ResolvedJavaMethod[] jdk.vm.ci.meta.ResolvedJavaType.getDeclaredMethods(boolean)'
    at com.oracle.truffle.runtime.hotspot.HotSpotTruffleRuntime.installCallBoundaryMethods(HotSpotTruffleRuntime.java:524)
    at com.oracle.truffle.runtime.hotspot.HotSpotTruffleRuntime.<init>(HotSpotTruffleRuntime.java:171)
    at com.oracle.truffle.runtime.hotspot.HotSpotTruffleRuntimeAccess.createRuntime(HotSpotTruffleRuntimeAccess.java:186)
    at com.oracle.truffle.runtime.hotspot.HotSpotTruffleRuntimeAccess.getRuntime(HotSpotTruffleRuntimeAccess.java:73)
    at com.oracle.truffle.api.Truffle.createRuntime(Truffle.java:145)
    at com.oracle.truffle.api.Truffle$1.run(Truffle.java:176)
    at com.oracle.truffle.api.Truffle$1.run(Truffle.java:174)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
oubidar-Abderrahim commented 1 week ago
Describe GraalVM and your environment:

GraalVM version: 23.1.2
JDK major version: 17
OS: Linux
  1. GraalVM 23.1.2 is outdated, please always use the latest release before reporting issues.
  2. Your JDK major version cannot be 17 if you're using 23.1.2, this version is based on JDK 21. please clarify what JDK you're actually using. it would be best to share the output of java -version
  3. What architecture is used in you Linux machine? please provide the output of uname -a
Steps to reproduce the issue
mvn clean install

Please provide a full reproduce example we can run

shuowang97 commented 1 week ago

Thanks for your help!

  1. We're using the org.graalvm.polyglot package and it starts from 23.x.x.
  2. I did try it with 24.x.x for our JDK17 environment but it didn't work. 23 works fine though
  3. I cannot reproduce in my macOS + JDK17 environment, the issue is only in the cloud scenarios
  4. Output of uname -a: Linux 542c1360ca23 6.5.0-1025-azure #\26~22.04.1-Ubuntu SMP Thu Jul 11 22:33:04 UTC 2024 x86_64 GNU/Linux
shuowang97 commented 1 day ago

By removing this surefire argline configuration, it can be executed, but not sure the reason yet.

`

                    <configuration>
                    <argLine>@{argLine} -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI &#45;&#45;add-modules jdk.internal.vm.ci &#45;&#45;add-exports=java.base/jdk.internal.misc=jdk.graal.compiler &#45;&#45;upgrade-module-path=${compiler.dir}</argLine>
                    </configuration>

`