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

quarkus-integration-test-redis-client native build fails with 22.3.0-dev mandrel #27211

Closed
jerboaa opened this issue Aug 9, 2022 · 5 comments · Fixed by #27225
Closed

quarkus-integration-test-redis-client native build fails with 22.3.0-dev mandrel #27211

jerboaa opened this issue Aug 9, 2022 · 5 comments · Fixed by #27225
Labels
Milestone

Comments

@jerboaa
Copy link
Contributor

jerboaa commented Aug 9, 2022

Describe the bug

Running the redis-client integration test using a Mandrel 22.3.0 dev build fails generating the native image with:

========================================================================================================================
GraalVM Native Image: Generating 'quarkus-integration-test-redis-client-999-SNAPSHOT-runner' (executable)...
========================================================================================================================
[1/7] Initializing...                                                                                    (7.1s @ 0.25GB)
 Version info: 'GraalVM 22.3.0-dev9e628e5c Java 11 Mandrel Distribution'
 Java version info: '11.0.16-beta+8-202207261748'
 C compiler: gcc (redhat, x86_64, 12.1.1)
 Garbage collector: Serial GC
 4 user-specific feature(s)
 - 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 for the [org.jboss.threads] categories
 - io.quarkus.runtime.graal.ResourcesFeature: Register each line in META-INF/quarkus-native-resources.txt as a resource on Substrate VM
 - org.graalvm.home.HomeFinderFeature: Finds GraalVM paths and its version number
[2/7] Performing analysis...  [*]                                                                       (20.8s @ 0.62GB)
   9,120 (86.72%) of 10,516 classes reachable
  12,409 (57.09%) of 21,736 fields reachable
  40,715 (46.75%) of 87,085 methods reachable
     414 classes,    20 fields, and   779 methods registered for reflection
       1 native library: stdc++

Fatal error: com.oracle.graal.pointsto.util.AnalysisError$ParsingError: Error encountered while parsing org.jboss.resteasy.reactive.common.headers.LinkDelegate$Parser.getLink() 
Parsing context:
   at org.jboss.resteasy.reactive.common.headers.LinkDelegate$Parser.getLink(LinkDelegate.java:29)
   at org.jboss.resteasy.reactive.common.headers.LinkDelegate.fromString(LinkDelegate.java:130)
   at org.jboss.resteasy.reactive.common.headers.LinkDelegate.fromString(LinkDelegate.java:15)
   at javax.ws.rs.core.MediaType.valueOf(MediaType.java:172)
   at org.jboss.resteasy.reactive.common.headers.HeaderUtil.getMediaType(HeaderUtil.java:117)
   at org.jboss.resteasy.reactive.common.jaxrs.ResponseImpl.getMediaType(ResponseImpl.java:208)
   at org.jboss.resteasy.reactive.server.core.ResteasyReactiveRequestContext.getResponseContentType(ResteasyReactiveRequestContext.java:496)
   at org.jboss.resteasy.reactive.server.handlers.ResponseHandler.handle(ResponseHandler.java:76)
   at io.quarkus.resteasy.reactive.server.runtime.QuarkusResteasyReactiveRequestContext.invokeHandler(QuarkusResteasyReactiveRequestContext.java:117)
   at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.run(AbstractResteasyReactiveContext.java:140)
   at org.jboss.resteasy.reactive.server.handlers.RestInitialHandler.beginProcessing(RestInitialHandler.java:49)
   at org.jboss.resteasy.reactive.server.vertx.ResteasyReactiveVertxHandler.handle(ResteasyReactiveVertxHandler.java:17)
   at org.jboss.resteasy.reactive.server.vertx.ResteasyReactiveVertxHandler.handle(ResteasyReactiveVertxHandler.java:7)
   at io.vertx.ext.web.impl.RouteState.handleFailure(RouteState.java:1290)
   at io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:170)
   at io.vertx.ext.web.impl.RoutingContextImpl.next(RoutingContextImpl.java:140)
   at io.vertx.ext.web.impl.RouterImpl.handle(RouterImpl.java:68)
   at io.vertx.ext.web.impl.RouterImpl.handle(RouterImpl.java:37)
   at io.vertx.mutiny.ext.web.Router.handle(Router.java:75)
   at io.vertx.mutiny.ext.web.Router.accept(Router.java:486)
   at io.vertx.mutiny.ext.web.Router.accept(Router.java:27)
   at java.base@11.0.16-beta/java.lang.Iterable.forEach(Iterable.java:75)
   at javax.enterprise.inject.spi.CDI.findAllProviders(CDI.java:125)
   at javax.enterprise.inject.spi.CDI.getCDIProvider(CDI.java:82)
   at javax.enterprise.inject.spi.CDI.current(CDI.java:64)
   at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:113)
   at io.quarkus.runtime.Quarkus.run(Quarkus.java:67)
   at io.quarkus.runtime.Quarkus.run(Quarkus.java:41)
   at io.quarkus.runtime.Quarkus.run(Quarkus.java:120)
   at io.quarkus.runner.GeneratedMain.main(Unknown Source)
   at app/org.graalvm.nativeimage.builder/com.oracle.svm.core.JavaMainWrapper.runCore0(JavaMainWrapper.java:171)
   at app/org.graalvm.nativeimage.builder/com.oracle.svm.core.JavaMainWrapper.runCore(JavaMainWrapper.java:131)
   at app/org.graalvm.nativeimage.builder/com.oracle.svm.core.JavaMainWrapper.run(JavaMainWrapper.java:219)
   at com.oracle.svm.core.code.IsolateEnterStub.JavaMainWrapper_run_5087f5482cc9a6abc971913ece43acb471d2631b(generated:0)

	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.DefaultSpecialInvokeTypeFlow.onObservedUpdate(DefaultSpecialInvokeTypeFlow.java:61)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.TypeFlow.update(TypeFlow.java:558)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.PointsToAnalysis$1.run(PointsToAnalysis.java:492)
	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:1426)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
Caused by: org.graalvm.compiler.java.BytecodeParser$BytecodeParserError: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Discovered a type for which getDeclaringClass0 cannot be called: javax.ws.rs.core.Link$Builder. This error is reported at image build time because class javax.ws.rs.core.Link$Builder is registered for linking at image build time by command line
	at parsing org.jboss.resteasy.reactive.common.headers.LinkDelegate$Parser.getLink(LinkDelegate.java:29)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.throwParserError(BytecodeParser.java:2506)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.throwParserError(SharedGraphBuilderPhase.java:105)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3367)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.handleBytecodeBlock(BytecodeParser.java:3319)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBlock(BytecodeParser.java:3164)
	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:84)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase.run(SharedGraphBuilderPhase.java:79)
	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:261)
	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:684)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.parse(MethodTypeFlowBuilder.java:168)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.apply(MethodTypeFlowBuilder.java:343)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.createFlowsGraph(MethodTypeFlow.java:93)
	... 13 more
Caused by: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Discovered a type for which getDeclaringClass0 cannot be called: javax.ws.rs.core.Link$Builder. This error is reported at image build time because class javax.ws.rs.core.Link$Builder is registered for linking at image build time by command line
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.SVMHost.handleLinkageError(SVMHost.java:423)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.SVMHost.getDeclaringClass(SVMHost.java:409)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.SVMHost.createHub(SVMHost.java:397)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.SVMHost.registerType(SVMHost.java:243)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisUniverse.createType(AnalysisUniverse.java:302)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisUniverse.lookupAllowUnresolved(AnalysisUniverse.java:212)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisUniverse.lookup(AnalysisUniverse.java:189)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisField.getDeclaredType(AnalysisField.java:168)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisField.<init>(AnalysisField.java:136)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.PointsToAnalysisField.<init>(PointsToAnalysisField.java:47)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.PointsToAnalysisFactory.createField(PointsToAnalysisFactory.java:40)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisUniverse.createField(AnalysisUniverse.java:386)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisUniverse.lookupAllowUnresolved(AnalysisUniverse.java:374)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.infrastructure.AnalysisConstantPool.lookupField(AnalysisConstantPool.java:51)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.lookupField(BytecodeParser.java:4194)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genGetField(BytecodeParser.java:4599)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.loadLocalObject(BytecodeParser.java:3891)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBytecode(BytecodeParser.java:5085)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3359)
	... 28 more
Caused by: java.lang.NoClassDefFoundError: javax/xml/bind/annotation/adapters/XmlAdapter
	at java.base/java.lang.Class.getDeclaringClass0(Native Method)
	at java.base/jdk.internal.reflect.GeneratedMethodAccessor13.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.SVMHost.getDeclaringClass(SVMHost.java:406)
	... 45 more
------------------------------------------------------------------------------------------------------------------------
                        2.2s (7.6% of total time) in 19 GCs | Peak RSS: 3.44GB | CPU load: 5.97
========================================================================================================================
Failed generating 'quarkus-integration-test-redis-client-999-SNAPSHOT-runner' after 28.3s.
Error: Image build request failed with exit status 1

Related GraalVM change that might be related to this issue:
oracle/graal@ce3d101

This is not reproducible with GraalVM CE dev build (at least for me), but seems mandrel specific.

Expected behavior

Native image build passes.

Actual behavior

The build fails with java.lang.NoClassDefFoundError: javax/xml/bind/annotation/adapters/XmlAdapter

How to Reproduce?

Get a mandrel dev build artefact from:
https://github.com/graalvm/mandrel/runs/7589035097

For example:
https://github.com/graalvm/mandrel/suites/7588764894/artifacts/314323177

  1. Unzip the result, get jdk.tgz
  2. Untar the result. Gets mandrelvm folder that contains the build.
  3. Use it as GRAALVM_HOME
  4. Run the redis-client integration test:
pushd integration-tests
../mvnw --fae -pl 'redis-client' -Dnative -Dtest-containers -Dmaven.test.failure.ignore=true -Dstart-containers -Dnative.surefire.skip -Dformat.skip -Dno-descriptor-tests  -Dlog.level=ALL clean verify
popd

Output of uname -a or ver

No response

Output of java -version

11

GraalVM version (if different from Java)

22.3.0-dev (mandrel)

Quarkus version or git rev

dc51ebc

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

No response

Additional information

No response

@jerboaa jerboaa added the kind/bug Something isn't working label Aug 9, 2022
@quarkus-bot
Copy link

quarkus-bot bot commented Aug 9, 2022

@geoand
Copy link
Contributor

geoand commented Aug 10, 2022

cc @Sgitario

Sgitario added a commit to Sgitario/quarkus that referenced this issue Aug 10, 2022
The Link java class from JAXRS API contains a JAXB Adapter that inherits of XmlAdapter (from JAXB API). 

The Mandrel native build detects the missing dependency and fails with:

```
Fatal error: com.oracle.graal.pointsto.util.AnalysisError$ParsingError: Error encountered while parsing org.jboss.resteasy.reactive.common.headers.LinkDelegate$Parser.getLink() 
Parsing context:
   at org.jboss.resteasy.reactive.common.headers.LinkDelegate$Parser.getLink(LinkDelegate.java:29)
   at org.jboss.resteasy.reactive.common.headers.LinkDelegate.fromString(LinkDelegate.java:130)
   at org.jboss.resteasy.reactive.common.headers.LinkDelegate.fromString(LinkDelegate.java:15)
   at javax.ws.rs.core.MediaType.valueOf(MediaType.java:172)
   at org.jboss.resteasy.reactive.common.headers.HeaderUtil.getMediaType(HeaderUtil.java:117)
   at org.jboss.resteasy.reactive.common.jaxrs.ResponseImpl.getMediaType(ResponseImpl.java:208)
```

Fix quarkusio#27211
@galderz
Copy link
Member

galderz commented Aug 11, 2022

@jerboaa Did the GraalVM CE dev build you built use the same base JDK as Mandrel version that is failing? I have seen NoClassDefFoundError before due to JVMCI differences, e.g. #8081 (comment). I don't see any jdk.internal.vm.ci references in the stacktrace, but could be something to keep in mind.

@jerboaa
Copy link
Contributor Author

jerboaa commented Aug 18, 2022

@galderz No it likely didn't. GraalVM CE is based on labs JDK 11, vs. mandrel on stock OpenJDK 11. It could be the reason why it didn't show up with GraalVM CE 11.

@jerboaa
Copy link
Contributor Author

jerboaa commented Aug 23, 2022

Building quarkus-integration-test-grpc-interceptors-999-SNAPSHOT-runner seems to have the same problem.

@quarkus-bot quarkus-bot bot added this to the 2.13 - main milestone Aug 29, 2022
fercomunello pushed a commit to fercomunello/quarkus that referenced this issue Aug 31, 2022
The Link java class from JAXRS API contains a JAXB Adapter that inherits of XmlAdapter (from JAXB API). 

The Mandrel native build detects the missing dependency and fails with:

```
Fatal error: com.oracle.graal.pointsto.util.AnalysisError$ParsingError: Error encountered while parsing org.jboss.resteasy.reactive.common.headers.LinkDelegate$Parser.getLink() 
Parsing context:
   at org.jboss.resteasy.reactive.common.headers.LinkDelegate$Parser.getLink(LinkDelegate.java:29)
   at org.jboss.resteasy.reactive.common.headers.LinkDelegate.fromString(LinkDelegate.java:130)
   at org.jboss.resteasy.reactive.common.headers.LinkDelegate.fromString(LinkDelegate.java:15)
   at javax.ws.rs.core.MediaType.valueOf(MediaType.java:172)
   at org.jboss.resteasy.reactive.common.headers.HeaderUtil.getMediaType(HeaderUtil.java:117)
   at org.jboss.resteasy.reactive.common.jaxrs.ResponseImpl.getMediaType(ResponseImpl.java:208)
```

Fix quarkusio#27211
evanchooly pushed a commit to nenros/quarkus that referenced this issue Sep 8, 2022
The Link java class from JAXRS API contains a JAXB Adapter that inherits of XmlAdapter (from JAXB API). 

The Mandrel native build detects the missing dependency and fails with:

```
Fatal error: com.oracle.graal.pointsto.util.AnalysisError$ParsingError: Error encountered while parsing org.jboss.resteasy.reactive.common.headers.LinkDelegate$Parser.getLink() 
Parsing context:
   at org.jboss.resteasy.reactive.common.headers.LinkDelegate$Parser.getLink(LinkDelegate.java:29)
   at org.jboss.resteasy.reactive.common.headers.LinkDelegate.fromString(LinkDelegate.java:130)
   at org.jboss.resteasy.reactive.common.headers.LinkDelegate.fromString(LinkDelegate.java:15)
   at javax.ws.rs.core.MediaType.valueOf(MediaType.java:172)
   at org.jboss.resteasy.reactive.common.headers.HeaderUtil.getMediaType(HeaderUtil.java:117)
   at org.jboss.resteasy.reactive.common.jaxrs.ResponseImpl.getMediaType(ResponseImpl.java:208)
```

Fix quarkusio#27211
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants