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

Getting java.lang.UnsatisfiedLinkError: jdk.internal.loader.BootLoader.getSystemPackageNames() #2724

Closed
zcaudate opened this issue Jul 30, 2020 · 6 comments
Assignees
Milestone

Comments

@zcaudate
Copy link

I'm looking to get Jep working with GraalVm and got quite far before getting this error. I've attached the reflect-config and jni-config with this issue.

reflect-config.txt
jni-config.txt

All the classes dependencies are there but I'm now stuck on a really cryptic error. Any help would be great.

java.lang.UnsatisfiedLinkError: jdk.internal.loader.BootLoader.getSystemPackageNames()[Ljava/lang/String; [symbol: Java_jdk_internal_loader_BootLoader_getSystemPackageNames or Java_jdk_internal_loader_BootLoader_getSystemPackageNames__]
        at com.oracle.svm.jni.access.JNINativeLinkage.getOrFindEntryPoint(JNINativeLinkage.java:145)
        at com.oracle.svm.jni.JNIGeneratedMethodSupport.nativeCallAddress(JNIGeneratedMethodSupport.java:57)
        at jdk.internal.loader.BootLoader.getSystemPackageNames(BootLoader.java)
        at jdk.internal.loader.BootLoader.packages(BootLoader.java:192)
        at java.lang.ClassLoader.getPackages(ClassLoader.java:2354)
        at java.lang.Package.getPackages(Package.java:377)
        at jep.ClassList.loadPackages(ClassList.java:170)
        at jep.ClassList.<init>(ClassList.java:68)
        at jep.ClassList.getInstance(ClassList.java:366)
        at jep.Jep.setupJavaImportHook(Jep.java:320)
        at jep.Jep.configureInterpreter(Jep.java:310)
        at jep.SharedInterpreter.configureInterpreter(SharedInterpreter.java:64)
        at jep.Jep.<init>(Jep.java:282)
        at jep.SharedInterpreter.<init>(SharedInterpreter.java:56)
@zcaudate
Copy link
Author

It compiles fine, but when I run the compiled program, it gives me the error. I'm using

OpenJDK Runtime Environment GraalVM CE 20.1.0 (build 11.0.7+10-jvmci-20.1-b02)
OpenJDK 64-Bit Server VM GraalVM CE 20.1.0 (build 11.0.7+10-jvmci-20.1-b02, mixed mode, sharing)

@zcaudate
Copy link
Author

I've put together a sample repo demonstrating the issue:

https://github.com/zcaudate/sample-jep-graal

@teshull teshull self-assigned this Oct 2, 2020
@christianwimmer christianwimmer added this to To do in Native Image via automation Oct 5, 2020
@christianwimmer christianwimmer moved this from To do to In progress in Native Image Oct 5, 2020
@christianwimmer christianwimmer added this to the 20.3 milestone Oct 5, 2020
@teshull teshull modified the milestones: 20.3, 21.1 Dec 16, 2020
@zapster zapster modified the milestones: 21.1, 21.2 May 25, 2021
@zapster
Copy link
Member

zapster commented May 25, 2021

The issue has been fixed in b0bce9e.

@zapster zapster closed this as completed May 25, 2021
Native Image automation moved this from In progress to Done May 25, 2021
@zcaudate
Copy link
Author

@zapster thanks! Can you briefly explain (if possible) what the issue was and which version of graal I should use to run the sample project?

@zapster
Copy link
Member

zapster commented May 26, 2021

@zcaudate sure!

Can you briefly explain (if possible) what the issue was

JDK 9 introduced jdk.internal.loader.BootLoader.packages() to retrieve all packages loaded by the boot class loader. Internally, that function calls the native function jdk.internal.loader.BootLoader.getSystemPackageNames() which does not exist in native images. Thus, the error message you reported. The change adds support for BootLoader.packages() (see b0bce9e#diff-422e3fa386126a69506423650c878a251e18cc6e6cfdb39d87923a88a97628a3).

which version of graal I should use to run the sample project?

The fix will be included in the next mainline release which will be 21.2.

@zcaudate
Copy link
Author

oh awesome. thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Native Image
  
Done
Development

No branches or pull requests

5 participants