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.42k stars 1.64k forks source link

[Native Image] ImageLayerLoader unable to restore state of annotations #10101

Open Sanne opened 4 days ago

Sanne commented 4 days ago

Describe the Issue

When ImageLayerLoader#createBaseLayerMethod is loading the layer's methodData it's defining annotations as well, but these annotations seem lacking their attributes.

In some cases not having these values leads to critical failures; for example GraalVM itself makes use of the annotation com.oracle.svm.core.AlwaysInline which strictly requires a value for its main attribute. This is used, for example, in Target_jdk_internal_foreign_SegmentFactories.

The lack of this attribute leads to the annotation being invalid, which in turn results in a critical compilation error:

Fatal error: com.oracle.graal.pointsto.util.AnalysisError$ParsingError: Error encountered while parsing com.oracle.svm.core.foreign.Util_java_lang_foreign_SymbolLookup$1.find(Target_java_lang_foreign_SymbolLookup.java:169) 
Parsing context:
   at com.oracle.svm.core.foreign.Target_jdk_internal_foreign_SystemLookup.find(Target_jdk_internal_foreign_SystemLookup.java:43)
   at root method.(Unknown Source)

    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.AnalysisError.parsingError(AnalysisError.java:165)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.createFlowsGraph(MethodTypeFlow.java:189)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.ensureFlowsGraphCreated(MethodTypeFlow.java:152)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.getOrCreateMethodFlowsGraphInfo(MethodTypeFlow.java:110)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.typestate.DefaultVirtualInvokeTypeFlow.onObservedUpdate(DefaultVirtualInvokeTypeFlow.java:119)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.TypeFlow.update(TypeFlow.java:870)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.PointsToAnalysis$1.run(PointsToAnalysis.java:600)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.CompletionExecutor.executeCommand(CompletionExecutor.java:166)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.CompletionExecutor.lambda$executeService$0(CompletionExecutor.java:152)
    at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.compute(ForkJoinTask.java:1735)
    at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.compute(ForkJoinTask.java:1726)
    at java.base/java.util.concurrent.ForkJoinTask$InterruptibleTask.exec(ForkJoinTask.java:1650)
    at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:507)
    at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1459)
    at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:2035)
    at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:191)
Caused by: jdk.graal.compiler.debug.GraalError: Error in record 57 (field -1)
    at jdk.graal.compiler/jdk.graal.compiler.util.ObjectCopier$Decoder.decode(ObjectCopier.java:555)
    at jdk.graal.compiler/jdk.graal.compiler.util.ObjectCopier.decode(ObjectCopier.java:404)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageLayerLoader.getAnalysisParsedGraph(ImageLayerLoader.java:820)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisMethod.lambda$getBaseLayerGraph$0(AnalysisMethod.java:1003)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisMethod.setGraph(AnalysisMethod.java:1023)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisMethod.getBaseLayerGraph(AnalysisMethod.java:1003)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisMethod.ensureGraphParsedHelper(AnalysisMethod.java:977)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisMethod.ensureGraphParsed(AnalysisMethod.java:958)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.phases.InlineBeforeAnalysisGraphDecoder.lookupEncodedGraph(InlineBeforeAnalysisGraphDecoder.java:181)
    at jdk.graal.compiler/jdk.graal.compiler.replacements.PEGraphDecoder.doInline(PEGraphDecoder.java:1215)
    at jdk.graal.compiler/jdk.graal.compiler.replacements.PEGraphDecoder.tryInline(PEGraphDecoder.java:1198)
    at jdk.graal.compiler/jdk.graal.compiler.replacements.PEGraphDecoder.trySimplifyInvoke(PEGraphDecoder.java:1053)
    at jdk.graal.compiler/jdk.graal.compiler.replacements.PEGraphDecoder.handleInvokeWithCallTarget(PEGraphDecoder.java:1005)
    at jdk.graal.compiler/jdk.graal.compiler.replacements.PEGraphDecoder.handleInvoke(PEGraphDecoder.java:991)
    at jdk.graal.compiler/jdk.graal.compiler.nodes.GraphDecoder.processNextNode(GraphDecoder.java:926)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.phases.InlineBeforeAnalysisGraphDecoder.processNextNode(InlineBeforeAnalysisGraphDecoder.java:269)
    at jdk.graal.compiler/jdk.graal.compiler.nodes.GraphDecoder.decode(GraphDecoder.java:654)
    at jdk.graal.compiler/jdk.graal.compiler.replacements.PEGraphDecoder.decode(PEGraphDecoder.java:895)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.phases.InlineBeforeAnalysis.decodeGraph(InlineBeforeAnalysis.java:73)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.parse(MethodTypeFlowBuilder.java:239)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.apply(MethodTypeFlowBuilder.java:715)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.createFlowsGraph(MethodTypeFlow.java:167)
    ... 14 more
Caused by: com.oracle.svm.hosted.annotation.AnnotationMetadata$AnnotationExtractionError: Failed to process '@com.oracle.svm.core.AlwaysInline()': java.lang.reflect.InvocationTargetException
    at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.annotation.AnnotationValue.lambda$new$0(AnnotationValue.java:95)
    at java.base/java.util.HashMap.forEach(HashMap.java:1430)
    at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.annotation.AnnotationValue.<init>(AnnotationValue.java:90)
    at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:215)
    at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:1024)
    at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:570)
    at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560)
    at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:636)
    at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:291)
    at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:656)
    at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:662)
    at java.base/java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:667)
    at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.annotation.SubstrateAnnotationExtractor.getAnnotationData(SubstrateAnnotationExtractor.java:189)
    at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.annotation.SubstrateAnnotationExtractor.hasAnnotation(SubstrateAnnotationExtractor.java:149)
    at org.graalvm.nativeimage/org.graalvm.nativeimage.AnnotationAccess.isAnnotationPresent(AnnotationAccess.java:82)
    at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.cenum.CEnumCallWrapperSubstitutionProcessor.lookup(CEnumCallWrapperSubstitutionProcessor.java:54)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.infrastructure.SubstitutionProcessor$ChainedSubstitutionProcessor.lookup(SubstitutionProcessor.java:121)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.infrastructure.SubstitutionProcessor$ChainedSubstitutionProcessor.lookup(SubstitutionProcessor.java:121)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.infrastructure.SubstitutionProcessor$ChainedSubstitutionProcessor.lookup(SubstitutionProcessor.java:121)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisUniverse.lookupAllowUnresolved(AnalysisUniverse.java:417)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisUniverse.lookup(AnalysisUniverse.java:396)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageLayerLoader.createBaseLayerMethod(ImageLayerLoader.java:749)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageLayerLoader.loadMethod(ImageLayerLoader.java:709)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageLayerLoader.getAnalysisMethod(ImageLayerLoader.java:755)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageLayerSnapshotUtil$AnalysisMethodBuiltIn.decode(ImageLayerSnapshotUtil.java:355)
    at jdk.graal.compiler/jdk.graal.compiler.util.ObjectCopier$Decoder.decode(ObjectCopier.java:489)
    ... 35 more

I do also wonder what other problems are likely going to be caused by this, I believe many of our frameworks would need to read the actual annotation attributes; it seems that the current code would fallback to their default values, which is not correct.

Using the latest version of GraalVM can resolve many issues.

GraalVM Version

openjdk version "24" 2025-03-18
OpenJDK Runtime Environment GraalVM CE 24-dev+23.1 (build 24+23-jvmci-b01)
OpenJDK 64-Bit Server VM GraalVM CE 24-dev+23.1 (build 24+23-jvmci-b01, mixed mode, sharing)

Built from e238132d615da50c4d380c76dbe548caf94e5834

Operating System and Version

Fedora Linux 41

Build Command

Core layer preparation:

/opt/graalvm-localbuild/bin/native-image -H:LayerCreate=libcore.nil,module=java.base,module=java.sql --no-fallback --link-at-build-time --initialize-at-run-time=sun.java2d --initialize-at-run-time=sun.font --initialize-at-run-time=sun.awt.X11 -J-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 -H:-AddAllCharsets -o libcore.nil

Failing build:

/opt/graalvm-localbuild/bin/native-image -H:LayerUse=libcore.nil -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -J-Dsun.nio.ch.maxUpdateArraySize=100 -J-Duser.language=en -J-Duser.country=GB -J-Dlogging.initial-configurator.min-level=500 -J-Dvertx.logger-delegate-factory-class-name=io.quarkus.vertx.core.runtime.VertxLogDelegateFactory -J-Dvertx.disableDnsResolver=true -J-Dio.netty.leakDetection.level=DISABLED -J-Dio.netty.allocator.maxOrder=3 -H:+UnlockExperimentalVMOptions -H:IncludeLocales=en-GB -H:-UnlockExperimentalVMOptions -J-Dfile.encoding=UTF-8 --features=io.quarkus.runner.Feature,io.quarkus.runtime.graal.DisableLoggingFeature -J--add-exports=java.security.jgss/sun.security.krb5=ALL-UNNAMED -J--add-exports=java.security.jgss/sun.security.jgss=ALL-UNNAMED -J--add-opens=java.base/java.text=ALL-UNNAMED -J--add-opens=java.base/java.io=ALL-UNNAMED -J--add-opens=java.base/java.lang.invoke=ALL-UNNAMED -J--add-opens=java.base/java.util=ALL-UNNAMED -H:+UnlockExperimentalVMOptions -H:BuildOutputJSONFile=getting-started-1.0.0-SNAPSHOT-runner-build-output-stats.json -H:-UnlockExperimentalVMOptions -H:+UnlockExperimentalVMOptions -H:+GenerateBuildArtifactsFile -H:-UnlockExperimentalVMOptions -H:+UnlockExperimentalVMOptions -H:+AllowFoldMethods -H:-UnlockExperimentalVMOptions -H:+UnlockExperimentalVMOptions -H:+ForeignAPISupport -H:-UnlockExperimentalVMOptions -J-Djava.awt.headless=true --no-fallback --link-at-build-time -H:+UnlockExperimentalVMOptions -H:+ReportExceptionStackTraces -H:-UnlockExperimentalVMOptions -H:-AddAllCharsets --enable-url-protocols=http -H:NativeLinkerOption=-no-pie --enable-monitoring=heapdump -H:+UnlockExperimentalVMOptions -H:-UseServiceLoaderFeature -H:-UnlockExperimentalVMOptions -J--add-exports=org.graalvm.nativeimage/org.graalvm.nativeimage.impl=ALL-UNNAMED --exclude-config io\.netty\.netty-codec /META-INF/native-image/io\.netty/netty-codec/generated/handlers/reflect-config\.json --exclude-config io\.netty\.netty-handler /META-INF/native-image/io\.netty/netty-handler/generated/handlers/reflect-config\.json --initialize-at-run-time=sun.awt --initialize-at-runtime=sun.font -J-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005 -jar getting-started-1.0.0-SNAPSHOT-runner.jar

Expected Behavior

To be able to use annotations as usual.

Actual Behavior

Failed build

Steps to Reproduce

I hope the description I provided is clear enough as I pointed to the specific code which is problematic.

Additional Context

No response

Build Log Output and Error Messages

No response

Zeavee commented 2 days ago

Hi, this PR should fix this issue for a lot of cases https://github.com/oracle/graal/pull/10100.

However, some annotation members (arrays, classes or other annotations) still cannot be correctly loaded.

Sanne commented 2 days ago

Awesome, thank you! Will test it soon - it might be good enough to keep exploring further.

Sanne commented 2 days ago

@Zeavee thanks that looks like progress indeed! However I still can't buid it successfully, it looks like the annotation attributes aren't retaining the right type:

The build process encountered an unexpected error:

com.oracle.svm.core.util.VMError$HostedError: InternalFeature defined by com.oracle.svm.hosted.imagelayer.LayeredDispatchTableSupportFeature unexpectedly failed with a(n) jdk.graal.compiler.debug.GraalError
    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:304)
    at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.FeatureHandler.forEachFeature(FeatureHandler.java:95)
    at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:808)
    at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:567)
    at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:533)
    at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:545)
    at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:732)
    at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.start(NativeImageGeneratorRunner.java:151)
    at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:99)
Caused by: jdk.graal.compiler.debug.GraalError: Error in record 50 (field -1)
    at jdk.graal.compiler/jdk.graal.compiler.util.ObjectCopier$Decoder.decode(ObjectCopier.java:555)
    at jdk.graal.compiler/jdk.graal.compiler.util.ObjectCopier.decode(ObjectCopier.java:404)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageLayerLoader.getAnalysisParsedGraph(ImageLayerLoader.java:848)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisMethod.lambda$getBaseLayerGraph$0(AnalysisMethod.java:1003)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisMethod.setGraph(AnalysisMethod.java:1023)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisMethod.getBaseLayerGraph(AnalysisMethod.java:1003)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisMethod.ensureGraphParsedHelper(AnalysisMethod.java:977)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisMethod.ensureGraphParsed(AnalysisMethod.java:958)
    at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.heap.SVMImageLayerLoader.initializeBaseLayerMethod(SVMImageLayerLoader.java:201)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageLayerLoader.initializeBaseLayerMethod(ImageLayerLoader.java:817)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisUniverse.createMethod(AnalysisUniverse.java:442)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisUniverse.lookupAllowUnresolved(AnalysisUniverse.java:420)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisUniverse.lookup(AnalysisUniverse.java:396)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisType.getOrCalculateOpenTypeWorldDispatchTableMethods(AnalysisType.java:1405)
    at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.imagelayer.LayeredDispatchTableSupportFeature.beforeAnalysis(LayeredDispatchTableSupport.java:747)
    at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.lambda$runPointsToAnalysis$0(NativeImageGenerator.java:808)
    at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.FeatureHandler.forEachFeature(FeatureHandler.java:93)
    ... 7 more
Caused by: com.oracle.svm.hosted.annotation.AnnotationMetadata$AnnotationExtractionError: Failed to process '@com.oracle.svm.core.annotate.TargetElement(name="", onlyWith="[Ljava.lang.Class;@39a55e10")': java.lang.reflect.InvocationTargetException
    at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.annotation.AnnotationMemberValue.getMemberValue(AnnotationMemberValue.java:78)
    at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.annotation.AnnotationValue.lambda$new$0(AnnotationValue.java:90)
    at java.base/java.util.HashMap.forEach(HashMap.java:1430)
    at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.annotation.AnnotationValue.<init>(AnnotationValue.java:89)
    at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:215)
    at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:1024)
    at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:570)
    at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560)
    at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:636)
    at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:291)
    at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:656)
    at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:662)
    at java.base/java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:667)
    at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.annotation.SubstrateAnnotationExtractor.getAnnotationData(SubstrateAnnotationExtractor.java:189)
    at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.annotation.SubstrateAnnotationExtractor.hasAnnotation(SubstrateAnnotationExtractor.java:149)
    at org.graalvm.nativeimage/org.graalvm.nativeimage.AnnotationAccess.isAnnotationPresent(AnnotationAccess.java:82)
    at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.cenum.CEnumCallWrapperSubstitutionProcessor.lookup(CEnumCallWrapperSubstitutionProcessor.java:54)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.infrastructure.SubstitutionProcessor$ChainedSubstitutionProcessor.lookup(SubstitutionProcessor.java:121)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.infrastructure.SubstitutionProcessor$ChainedSubstitutionProcessor.lookup(SubstitutionProcessor.java:121)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.infrastructure.SubstitutionProcessor$ChainedSubstitutionProcessor.lookup(SubstitutionProcessor.java:121)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisUniverse.lookupAllowUnresolved(AnalysisUniverse.java:417)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisUniverse.lookup(AnalysisUniverse.java:396)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageLayerLoader.createBaseLayerMethod(ImageLayerLoader.java:777)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageLayerLoader.loadMethod(ImageLayerLoader.java:740)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageLayerLoader.getAnalysisMethod(ImageLayerLoader.java:783)
    at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageLayerSnapshotUtil$AnalysisMethodBuiltIn.decode(ImageLayerSnapshotUtil.java:370)
    at jdk.graal.compiler/jdk.graal.compiler.util.ObjectCopier$Decoder.decode(ObjectCopier.java:489)
    ... 23 more
Caused by: java.lang.reflect.InvocationTargetException
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:110)
    at java.base/java.lang.reflect.Method.invoke(Method.java:567)
    at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.annotation.AnnotationMemberValue.getMemberValue(AnnotationMemberValue.java:76)
    ... 49 more
Caused by: java.lang.ClassCastException: class java.lang.String cannot be cast to class [Ljava.lang.Class; (java.lang.String and [Ljava.lang.Class; are in module java.base of loader 'bootstrap')
    at jdk.proxy2/jdk.proxy2.$Proxy36.onlyWith(Unknown Source)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
    ... 51 more