Open KengoTODA opened 3 years ago
It was caused because AnalysisContext
class could not initialized by the following error:
Exception in thread "main" java.lang.ExceptionInInitializerError
at com.oracle.svm.core.classinitialization.ClassInitializationInfo.initialize(ClassInitializationInfo.java:315)
at org.apache.bcel.util.SyntheticRepository.getInstance(SyntheticRepository.java:44)
at org.apache.bcel.Repository.<clinit>(Repository.java:37)
at com.oracle.svm.core.classinitialization.ClassInitializationInfo.invokeClassInitializer(ClassInitializationInfo.java:375)
at com.oracle.svm.core.classinitialization.ClassInitializationInfo.initialize(ClassInitializationInfo.java:295)
at edu.umd.cs.findbugs.ba.AnalysisContext.<clinit>(AnalysisContext.java:132)
at com.oracle.svm.core.classinitialization.ClassInitializationInfo.invokeClassInitializer(ClassInitializationInfo.java:375)
at com.oracle.svm.core.classinitialization.ClassInitializationInfo.initialize(ClassInitializationInfo.java:295)
at edu.umd.cs.findbugs.FindBugs2.createAnalysisContext(FindBugs2.java:889)
at edu.umd.cs.findbugs.FindBugs2.execute(FindBugs2.java:241)
at jp.skypencil.spotbugs.cli.App.call(App.kt:82)
at jp.skypencil.spotbugs.cli.App.call(App.kt:34)
at picocli.CommandLine.executeUserObject(CommandLine.java:1953)
at picocli.CommandLine.access$1300(CommandLine.java:145)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2352)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2314)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
at picocli.CommandLine$RunLast.execute(CommandLine.java:2316)
at picocli.CommandLine.execute(CommandLine.java:2078)
at jp.skypencil.spotbugs.cli.App$Companion.main(App.kt:174)
at jp.skypencil.spotbugs.cli.App.main(App.kt)
Caused by: java.lang.NullPointerException
at sun.nio.fs.UnixPath.normalizeAndCheck(UnixPath.java:75)
at sun.nio.fs.UnixPath.<init>(UnixPath.java:69)
at sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:279)
This error comes from the following line in Apache BCEL:
-Djava.home=$JAVA_HOME
option will solve this problem, but it brings another exception:
Exception in thread "main" java.lang.ExceptionInInitializerError
at com.oracle.svm.core.classinitialization.ClassInitializationInfo.initialize(ClassInitializationInfo.java:315)
at org.apache.bcel.util.SyntheticRepository.getInstance(SyntheticRepository.java:44)
at org.apache.bcel.Repository.<clinit>(Repository.java:37)
at com.oracle.svm.core.classinitialization.ClassInitializationInfo.invokeClassInitializer(ClassInitializationInfo.java:375)
at com.oracle.svm.core.classinitialization.ClassInitializationInfo.initialize(ClassInitializationInfo.java:295)
at edu.umd.cs.findbugs.ba.AnalysisContext.<clinit>(AnalysisContext.java:132)
at com.oracle.svm.core.classinitialization.ClassInitializationInfo.invokeClassInitializer(ClassInitializationInfo.java:375)
at com.oracle.svm.core.classinitialization.ClassInitializationInfo.initialize(ClassInitializationInfo.java:295)
at edu.umd.cs.findbugs.FindBugs2.createAnalysisContext(FindBugs2.java:889)
at edu.umd.cs.findbugs.FindBugs2.execute(FindBugs2.java:241)
at jp.skypencil.spotbugs.cli.App.call(App.kt:82)
at jp.skypencil.spotbugs.cli.App.call(App.kt:34)
at picocli.CommandLine.executeUserObject(CommandLine.java:1953)
at picocli.CommandLine.access$1300(CommandLine.java:145)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2352)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2314)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
at picocli.CommandLine$RunLast.execute(CommandLine.java:2316)
at picocli.CommandLine.execute(CommandLine.java:2078)
at jp.skypencil.spotbugs.cli.App$Companion.main(App.kt:174)
at jp.skypencil.spotbugs.cli.App.main(App.kt)
Caused by: java.nio.file.ProviderNotFoundException: Provider "jrt" not found
at java.nio.file.FileSystems.getFileSystem(FileSystems.java:234)
at org.apache.bcel.util.ModularRuntimeImage.<init>(ModularRuntimeImage.java:58)
at org.apache.bcel.util.ClassPath$JrtModules.<init>(ClassPath.java:356)
at org.apache.bcel.util.ClassPath.<init>(ClassPath.java:569)
at org.apache.bcel.util.ClassPath.<clinit>(ClassPath.java:443)
at com.oracle.svm.core.classinitialization.ClassInitializationInfo.invokeClassInitializer(ClassInitializationInfo.java:375)
at com.oracle.svm.core.classinitialization.ClassInitializationInfo.initialize(ClassInitializationInfo.java:295)
... 21 more
probably related to https://github.com/oracle/graal/issues/2809
0a59418 added -H:+AllowJRTFileSystem
option, and now exception has been changed to:
Exception in thread "main" java.lang.UnsatisfiedLinkError: jdk.internal.jimage.NativeImageBuffer.getNativeMap(Ljava/lang/String;)Ljava/nio/ByteBuffer; [symbol: Java_jdk_internal_jimage_NativeImageBuffer_getNativeMap or Java_jdk_internal_jimage_NativeImageBuffer_getNativeMap__Ljava_lang_String_2]
at com.oracle.svm.jni.access.JNINativeLinkage.getOrFindEntryPoint(JNINativeLinkage.java:153)
at com.oracle.svm.jni.JNIGeneratedMethodSupport.nativeCallAddress(JNIGeneratedMethodSupport.java:57)
at jdk.internal.jimage.NativeImageBuffer.getNativeMap(NativeImageBuffer.java)
at jdk.internal.jimage.BasicImageReader.<init>(BasicImageReader.java:95)
at jdk.internal.jimage.ImageReader$SharedImageReader.<init>(ImageReader.java:224)
at jdk.internal.jimage.ImageReader$SharedImageReader.open(ImageReader.java:238)
at jdk.internal.jimage.ImageReader.open(ImageReader.java:67)
at jdk.internal.jimage.ImageReader.open(ImageReader.java:71)
at jdk.internal.jrtfs.SystemImage.open(SystemImage.java:59)
at jdk.internal.jrtfs.JrtFileSystem.<init>(JrtFileSystem.java:90)
at jdk.internal.jrtfs.JrtFileSystemProvider.getTheFileSystem(JrtFileSystemProvider.java:207)
at jdk.internal.jrtfs.JrtFileSystemProvider.getFileSystem(JrtFileSystemProvider.java:221)
at java.nio.file.FileSystems.getFileSystem(FileSystems.java:231)
at org.apache.bcel.util.ModularRuntimeImage.<init>(ModularRuntimeImage.java:58)
at org.apache.bcel.util.ClassPath$JrtModules.<init>(ClassPath.java:356)
at org.apache.bcel.util.ClassPath.<init>(ClassPath.java:569)
Hi @KengoTODA! I hit the same issue from the Native Image side a few days ago. After a short research, I have solved it. So, I just wanted to inform you about a solution maybe you will find it useful. Here is a PR: https://github.com/oracle/graal/pull/4099 :smile:
Cool, thanks for your share!