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

DeletedElementException: Unsupported type java.util.JapaneseImperialCalendar is reachable when building native executable #37246

Closed
raweber42 opened this issue Nov 21, 2023 · 4 comments
Labels
area/native-image kind/bug Something isn't working

Comments

@raweber42
Copy link

Describe the bug

When I try to build my native image, I get an com.oracle.svm.hosted.substitute.DeletedElementException: Unsupported type java.util.JapaneseImperialCalendar is reachable error.
The image creation worked fine before. I just updated from Quarkus 3.1.2 to 3.5.2, maybe that could be causing the issue, but I can't find a useful hint in the migration guides.

I am not even using the JapaneseImperialCalendar! No idea how that came up there

Expected behavior

Native image builds fine.

Actual behavior

Native build fails with the given exceptions (see attached stacktrace)

How to Reproduce?

No response

Output of uname -a or ver

Darwin USER.local 23.1.0 Darwin Kernel Version 23.1.0: Mon Oct 9 21:28:31 PDT 2023; root:xnu-10002.41.9~6/RELEASE_ARM64_T8112 arm64

Output of java -version

No response

Mandrel or GraalVM version (if different from Java)

No response

Quarkus version or git rev

3.5.2

Build tool (ie. output of mvnw --version or gradlew --version)

mwnv

Additional information

[1/7] Initializing...                                                                                   (14.1s @ 0.92GB)
 Version info: 'GraalVM 22.3.0 Java 17 CE'
 Java version info: '17.0.5+8-jvmci-22.3-b08'
 C compiler: cc (apple, arm64, 14.0.3)
 Garbage collector: Serial GC
 12 user-specific feature(s)
 - com.google.api.gax.grpc.nativeimage.GrpcNettyFeature
 - com.google.api.gax.nativeimage.GoogleJsonClientFeature
 - com.google.api.gax.nativeimage.OpenCensusFeature
 - com.oracle.svm.thirdparty.gson.GsonFeature
 - io.quarkus.caffeine.runtime.graal.CacheConstructorsFeature
 - io.quarkus.hibernate.orm.runtime.graal.DisableLoggingFeature: Disables INFO logging during the analysis phase
 - io.quarkus.hibernate.validator.runtime.DisableLoggingFeature: Disables INFO logging during the analysis phase for the [org.hibernate.validator.internal.util.Version] categories
 - io.quarkus.jdbc.postgresql.runtime.graal.SQLXMLFeature
 - io.quarkus.runner.Feature: Auto-generated class by Quarkus from the existing extensions
 - io.quarkus.runtime.graal.DisableLoggingFeature: Disables INFO logging during the analysis phase
 - org.eclipse.angus.activation.nativeimage.AngusActivationFeature
 - org.hibernate.graalvm.internal.GraalVMStaticFeature: Hibernate ORM's static reflection registrations for GraalVM
13:27:25,106 WARNING [com.goo.api.gax.nat.NativeImageUtils] Failed to find io.grpc.netty.shaded.io.netty.channel.ProtocolNegotiators on the classpath for reflection.
[2/7] Performing analysis...  [13:27:27,120 WARN  [org.hib.orm.deprecation] HHH90000025: PostgreSQLDialect does not need to be specified explicitly using 'hibernate.dialect' (remove the property setting and it will be selected by default)
13:27:37,234 WARN  [io.net.res.dns.DnsServerAddressStreamProviders] Can not find io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider in the classpath, fallback to system defaults. This may result in incorrect DNS resolutions on MacOS. Check whether you have a dependency on 'io.netty:netty-resolver-dns-native-macos'
Warning: RecomputeFieldValue.FieldOffset automatic substitution failed. The automatic substitution registration was attempted because a call to sun.misc.Unsafe.objectFieldOffset(Field) was detected in the static initializer of com.google.protobuf.UnsafeUtil. Detailed failure reason(s): The argument of Unsafe.objectFieldOffset(Field) is not a constant field., Could not determine the field where the value produced by the call to sun.misc.Unsafe.objectFieldOffset(Field) for the field offset computation is stored. The call is not directly followed by a field store or by a sign extend node followed directly by a field store. 
[2/7] Performing analysis...  []                                                                        (30.0s @ 4.08GB)
  22’932 (94.35%) of 24’306 classes reachable
  30’837 (65.43%) of 47’131 fields reachable
 100’080 (82.75%) of 120’943 methods reachable
   1’601 classes,     0 fields, and     0 methods registered for reflection
       1 native library: -framework CoreServices

Fatal error: com.oracle.graal.pointsto.util.AnalysisError$ParsingError: Error encountered while parsing java.util.Calendar$Builder.build() 
Parsing context:
   at java.util.Calendar$Builder.build(Calendar.java:1474)
   at io.smallrye.graphql.transformation.CalendarTransformer.in(CalendarTransformer.java:32)
   at io.smallrye.graphql.transformation.CalendarTransformer.in(CalendarTransformer.java:13)
   at io.smallrye.graphql.execution.datafetcher.helper.ArgumentHelper.transformInput(ArgumentHelper.java:240)
   at io.smallrye.graphql.execution.datafetcher.helper.ArgumentHelper.singleTransform(ArgumentHelper.java:136)
   at io.smallrye.graphql.execution.datafetcher.helper.AbstractHelper.recursiveTransform(AbstractHelper.java:170)
   at io.smallrye.graphql.execution.datafetcher.helper.AbstractHelper.transformOrAdapt(AbstractHelper.java:89)
   at io.smallrye.graphql.execution.datafetcher.helper.FieldHelper.transformOrAdaptResponse(FieldHelper.java:40)
   at io.smallrye.graphql.execution.datafetcher.FieldDataFetcher.get(FieldDataFetcher.java:68)
   at graphql.execution.ExecutionStrategy.invokeDataFetcher(ExecutionStrategy.java:311)
   at graphql.execution.ExecutionStrategy.fetchField(ExecutionStrategy.java:287)
   at graphql.execution.ExecutionStrategy.resolveFieldWithInfo(ExecutionStrategy.java:213)
   at graphql.execution.AsyncExecutionStrategy.execute(AsyncExecutionStrategy.java:55)
   at graphql.execution.Execution.executeOperation(Execution.java:161)
   at graphql.execution.Execution.execute(Execution.java:103)
   at graphql.GraphQL.execute(GraphQL.java:565)
   at graphql.GraphQL.lambda$parseValidateAndExecute$12(GraphQL.java:484)
   at graphql.GraphQL$$Lambda$2697/0x0000000303d1b950.apply(Unknown Source)
   at java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:1187)
   at java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:2309)
   at graphql.GraphQL.handleAbortException(GraphQL.java:456)
   at graphql.GraphQL.executeAsync(GraphQL.java:447)
   at graphql.GraphQL.execute(GraphQL.java:365)
   at io.smallrye.graphql.execution.ExecutionService.writeSync(ExecutionService.java:236)
   at io.smallrye.graphql.execution.ExecutionService.execute(ExecutionService.java:187)
   at io.smallrye.graphql.execution.ExecutionService.executeAsync(ExecutionService.java:121)
   at io.smallrye.graphql.websocket.AbstractGraphQLWebsocketHandler.onOperationRequest(AbstractGraphQLWebsocketHandler.java:102)
   at io.smallrye.graphql.websocket.graphqltransportws.GraphQLTransportWSSubprotocolHandler.onMessage(GraphQLTransportWSSubprotocolHandler.java:54)
   at io.smallrye.graphql.websocket.AbstractGraphQLWebsocketHandler.onMessage(AbstractGraphQLWebsocketHandler.java:63)
   at io.quarkus.smallrye.graphql.runtime.SmallRyeGraphQLOverWebSocketHandler$$Lambda$2277/0x0000000303c8c6b0.handle(Unknown Source)
   at io.vertx.core.impl.future.FutureImpl$3.onFailure(FutureImpl.java:153)
   at io.vertx.core.impl.future.FutureBase.emitFailure(FutureBase.java:75)
   at io.vertx.core.impl.future.FutureImpl.addListener(FutureImpl.java:191)
   at io.vertx.core.impl.future.PromiseImpl.addListener(PromiseImpl.java:23)
   at io.vertx.core.impl.future.FutureImpl.onComplete(FutureImpl.java:164)
   at io.vertx.core.impl.future.PromiseImpl.onComplete(PromiseImpl.java:23)
   at io.vertx.core.impl.VertxImpl.initClustered(VertxImpl.java:221)
   at io.vertx.core.impl.VertxBuilder.clusteredVertx(VertxBuilder.java:261)
   at io.quarkus.vertx.core.runtime.VertxCoreRecorder.initialize(VertxCoreRecorder.java:230)
   at io.quarkus.vertx.core.runtime.VertxCoreRecorder$VertxSupplier.get(VertxCoreRecorder.java:619)
   at io.quarkus.vertx.core.runtime.VertxCoreRecorder$VertxSupplier.get(VertxCoreRecorder.java:598)
   at org.apache.camel.impl.engine.DefaultContextPluginManager.getContextPlugin(DefaultContextPluginManager.java:47)
   at org.apache.camel.impl.engine.DefaultCamelContextExtension.getContextPlugin(DefaultCamelContextExtension.java:586)
   at org.apache.camel.support.PluginHelper.getInternalProcessorFactory(PluginHelper.java:364)
   at org.apache.camel.support.PluginHelper.getInternalProcessorFactory(PluginHelper.java:357)
   at org.apache.camel.support.cache.DefaultProducerCache.<init>(DefaultProducerCache.java:86)
   at org.apache.camel.impl.engine.DefaultProducerTemplate.doBuild(DefaultProducerTemplate.java:775)
   at org.apache.camel.support.service.BaseService.build(BaseService.java:60)
   at org.apache.camel.support.service.BaseService.init(BaseService.java:75)
   at org.apache.camel.support.service.BaseService.start(BaseService.java:105)
   at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:126)
   at org.apache.camel.impl.engine.InternalServiceManager.deferStartService(InternalServiceManager.java:177)
   at org.apache.camel.impl.engine.InternalServiceManager.doAddService(InternalServiceManager.java:150)
   at org.apache.camel.impl.engine.InternalServiceManager.addService(InternalServiceManager.java:82)
   at org.apache.camel.impl.engine.InternalServiceManager.addService(InternalServiceManager.java:77)

        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.AnalysisError.parsingError(AnalysisError.java:153)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.createFlowsGraph(MethodTypeFlow.java:104)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.ensureFlowsGraphCreated(MethodTypeFlow.java:83)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.getOrCreateMethodFlowsGraph(MethodTypeFlow.java:65)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.typestate.DefaultVirtualInvokeTypeFlow.onObservedUpdate(DefaultVirtualInvokeTypeFlow.java:109)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.TypeFlow.update(TypeFlow.java:562)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.PointsToAnalysis$1.run(PointsToAnalysis.java:488)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.CompletionExecutor.executeCommand(CompletionExecutor.java:193)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.CompletionExecutor.lambda$executeService$0(CompletionExecutor.java:177)
        at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1395)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: org.graalvm.compiler.java.BytecodeParser$BytecodeParserError: com.oracle.svm.hosted.substitute.DeletedElementException: Unsupported type java.util.JapaneseImperialCalendar is reachable
To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The unsupported element is then reported at run time when it is accessed the first time.
        at parsing java.util.Calendar$Builder.build(Calendar.java:1506)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.throwParserError(BytecodeParser.java:2518)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.throwParserError(SharedGraphBuilderPhase.java:110)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3393)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.handleBytecodeBlock(BytecodeParser.java:3345)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBlock(BytecodeParser.java:3190)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.build(BytecodeParser.java:1138)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.buildRootMethod(BytecodeParser.java:1030)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.GraphBuilderPhase$Instance.run(GraphBuilderPhase.java:97)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase.run(SharedGraphBuilderPhase.java:84)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.run(Phase.java:49)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:446)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:42)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:38)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.AnalysisParsedGraph.parseBytecode(AnalysisParsedGraph.java:135)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisMethod.ensureGraphParsed(AnalysisMethod.java:685)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.parse(MethodTypeFlowBuilder.java:171)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.apply(MethodTypeFlowBuilder.java:349)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.createFlowsGraph(MethodTypeFlow.java:93)
        ... 13 more
Caused by: com.oracle.svm.hosted.substitute.DeletedElementException: Unsupported type java.util.JapaneseImperialCalendar is reachable
To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The unsupported element is then reported at run time when it is accessed the first time.
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.substitute.AnnotationSubstitutionProcessor.lookup(AnnotationSubstitutionProcessor.java:140)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.infrastructure.SubstitutionProcessor$ChainedSubstitutionProcessor.lookup(SubstitutionProcessor.java:125)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.infrastructure.SubstitutionProcessor$ChainedSubstitutionProcessor.lookup(SubstitutionProcessor.java:125)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisUniverse.lookupAllowUnresolved(AnalysisUniverse.java:210)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.infrastructure.WrappedConstantPool.lookupType(WrappedConstantPool.java:244)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.lookupType(BytecodeParser.java:4199)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genNewInstance(BytecodeParser.java:4493)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBytecode(BytecodeParser.java:5291)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3385)
        ... 28 more
------------------------------------------------------------------------------------------------------------------------
                        5.8s (12.7% of total time) in 28 GCs | Peak RSS: 3.50GB | CPU load: 3.73
========================================================================================================================
@raweber42 raweber42 added area/native-image kind/bug Something isn't working labels Nov 21, 2023
Copy link

quarkus-bot bot commented Nov 21, 2023

/cc @Karm (mandrel), @galderz (mandrel), @zakkak (mandrel,native-image)

@zakkak
Copy link
Contributor

zakkak commented Nov 21, 2023

Duplicate of #36975

@zakkak zakkak marked this as a duplicate of #36975 Nov 21, 2023
@zakkak zakkak closed this as completed Nov 21, 2023
@zakkak
Copy link
Contributor

zakkak commented Nov 21, 2023

@raweber42 please use Mandrel 23.1 or GraalVM for JDK 21 with Quarkus 3.5

@raweber42
Copy link
Author

Wow, that was fast! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/native-image kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants