quarkiverse / quarkus-azure-services

Quarkus extensions for Azure services
Apache License 2.0
13 stars 17 forks source link

Cross-dependency leads to problems with native build #205

Closed darkeagle1337 closed 1 month ago

darkeagle1337 commented 4 months ago

Describe the bug

I have a project with the latest quarkus version 3.7.4. This is an excerpt of my dependencies within the project

<dependency>
      <groupId>io.quarkiverse.cxf</groupId>
      <artifactId>quarkus-cxf</artifactId>
    </dependency>    
    <dependency>
      <groupId>io.quarkiverse.azureservices</groupId>
      <artifactId>quarkus-azure-storage-blob</artifactId>
      <version>1.0.2</version>
  </dependency>

The following error occur if I execute the command mvn -Pnative install

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.459 s
[INFO] Finished at: 2024-02-28T17:03:17+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.quarkus.platform:quarkus-maven-plugin:3.7.4:build (default) on project code-with-quarkus: Failed to build quarkus application: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[ERROR]         [error]: Build step io.quarkiverse.azure.jackson.datafromat.xml.deployment.JacksonDataformatXmlSupportProcessor#serviceProviders threw an exception: java.lang.NoClassDefFoundError: com/ctc/wstx/shaded/msv/org_isorelax/verifier/VerifierFactoryLoader
[ERROR]         at io.quarkiverse.azure.jackson.datafromat.xml.deployment.JacksonDataformatXmlSupportProcessor.serviceProviders(JacksonDataformatXmlSupportProcessor.java:46)
[ERROR]         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR]         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
[ERROR]         at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR]         at java.base/java.lang.reflect.Method.invoke(Method.java:568)
[ERROR]         at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:849)
[ERROR]         at io.quarkus.builder.BuildContext.run(BuildContext.java:256)
[ERROR]         at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538)
[ERROR]         at java.base/java.lang.Thread.run(Thread.java:840)
[ERROR]         at org.jboss.threads.JBossThread.run(JBossThread.java:501)
[ERROR] Caused by: java.lang.ClassNotFoundException: com.ctc.wstx.shaded.msv.org_isorelax.verifier.VerifierFactoryLoader
[ERROR]         at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
[ERROR]         at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
[ERROR]         at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
[ERROR]         at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
[ERROR]         at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:518)
[ERROR]         at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:468)
[ERROR]         ... 12 more
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.

Expected behavior

Successfully build in native mode

Actual behavior

No response

How to Reproduce?

If I remove one of the dependency the build will execute successfully. It doesn't matter which dependency I removed. Only If both dependencies are "active" I got a problem. I attached the sample project with the behaviour. code-with-quarkus.zip

No response

Output of uname -a or ver

No response

Output of java -version

OpenJDK Runtime Environment GraalVM CE 17.0.9+9.1 (build 17.0.9+9-jvmci-23.0-b22)

Quarkus version or git rev

3.7.4

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

Apache Maven 3.9.6 (bc0240f3c744dd6b6ec2920b3cd08dcc295161ae)

Additional information

No response

majguo commented 2 months ago

Thanks @darkeagle1337 for reporting the issue and @ppalaga for providing the solution in https://github.com/quarkiverse/quarkus-cxf/issues/1257.

The issue is fixed in #219, and we're going to rollout the fix in a new release (1.0.3) this month.

majguo commented 1 month ago

@darkeagle1337 The issue is fixed in release 1.0.3. Feel free to have a try and leave comments here if any questions.