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

Unable to use Camel Quarkus with this extension #58

Closed
Nillkki opened this issue Nov 20, 2020 · 4 comments
Closed

Unable to use Camel Quarkus with this extension #58

Nillkki opened this issue Nov 20, 2020 · 4 comments
Labels
dependencies Pull requests that update a dependency file

Comments

@Nillkki
Copy link

Nillkki commented Nov 20, 2020

Describe the bug
Adding this extension to POM breaks Quarkus startup(?) when also using Camel Quarkus.

Expected behavior
This extension should work with Camel Quarkus extensions. Running mvn verify with the example should result to success.

Actual behavior
Running Quarkus/test gives the following error:

java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
        [error]: Build step io.quarkus.jaxb.deployment.JaxbProcessor#processAnnotationsAndIndexFiles threw an exception: java.lang.RuntimeException: java.lang.ClassNotFoundException: //org/apache/camel/model/AggregateDefinition
        at io.quarkus.jaxb.deployment.JaxbProcessor.handleJaxbFile(JaxbProcessor.java:232)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
        at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
        at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
        at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
        at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
        at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
        at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:274)
        at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
        at java.base/java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1603)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
        at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
        at io.quarkus.jaxb.deployment.JaxbProcessor.processAnnotationsAndIndexFiles(JaxbProcessor.java:180)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:936)
        at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
        at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
        at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2046)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1578)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
        at java.base/java.lang.Thread.run(Thread.java:834)
        at org.jboss.threads.JBossThread.run(JBossThread.java:479)
Caused by: java.lang.ClassNotFoundException: //org/apache/camel/model/AggregateDefinition
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:398)
        at io.quarkus.jaxb.deployment.JaxbProcessor.handleJaxbFile(JaxbProcessor.java:223)
        ... 36 more

...

Caused by: io.quarkus.builder.BuildException: 
Build failure: Build failed due to errors
        [error]: Build step io.quarkus.jaxb.deployment.JaxbProcessor#processAnnotationsAndIndexFiles threw an exception: java.lang.RuntimeException: java.lang.ClassNotFoundException: //org/apache/camel/model/AggregateDefinition
        at io.quarkus.jaxb.deployment.JaxbProcessor.handleJaxbFile(JaxbProcessor.java:232)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
        at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
        at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
        at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
        at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
        at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
        at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:274)
        at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
        at java.base/java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1603)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
        at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
        at io.quarkus.jaxb.deployment.JaxbProcessor.processAnnotationsAndIndexFiles(JaxbProcessor.java:180)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:936)
        at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
        at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
        at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2046)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1578)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
        at java.base/java.lang.Thread.run(Thread.java:834)
        at org.jboss.threads.JBossThread.run(JBossThread.java:479)
Caused by: java.lang.ClassNotFoundException: //org/apache/camel/model/AggregateDefinition
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:398)
        at io.quarkus.jaxb.deployment.JaxbProcessor.handleJaxbFile(JaxbProcessor.java:223)
        ... 36 more

Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: //org/apache/camel/model/AggregateDefinition
Caused by: java.lang.ClassNotFoundException: //org/apache/camel/model/AggregateDefinition

To Reproduce
Steps to reproduce the behavior:

  1. Clone repo https://github.com/Nillkki/camel-quarkus-cxf-bug
  2. Run mvn verify
  3. Observe error during tests
  4. Remove quarkus-cxf from POM
  5. Rerun mvn verify and observe success
@dufoli
Copy link
Contributor

dufoli commented Nov 20, 2020

indeed the bug do not come from cxf extention but from jaxb one which is handle by quarkus project directly.
https://github.com/quarkusio/quarkus/blob/c325302438ec81c208e9b1911110c4562edc8b19/extensions/jaxb/deployment/src/main/java/io/quarkus/jaxb/deployment/JaxbProcessor.java

jaxb.index contain a class that is not present in classLoader.
it come from
https://github.com/apache/camel/blob/e3460f86f43e9a78a3c4777029fdf86fbe105903/core/camel-core-model/src/generated/resources/org/apache/camel/model/jaxb.index
and pkg contain "//org/apache/camel/model/" instead of org.apache.camel.model.
String pkg = p.toAbsolutePath().getParent().toString().substring(1).replace("/", ".") + ".";

so I guess it iss because you are on windows and replace ('/' is for linux... I will open a ticket on quarkus with fix.

@dufoli
Copy link
Contributor

dufoli commented Dec 3, 2020

I have not used gizmo generation but the code from cxf so I think it will be fixed when I will have cxf who handle code generation spi to have class generated during build time.

@doublefx
Copy link

doublefx commented Dec 9, 2020

Hi @dufoli

Have you already open an issue for this on Quarkus, if yes, can you paste the link pls?

@dufoli
Copy link
Contributor

dufoli commented Dec 9, 2020

it is there :
quarkusio/quarkus#13408

@Dufgui Dufgui added the dependencies Pull requests that update a dependency file label Dec 13, 2020
shumonsharif added a commit that referenced this issue Feb 13, 2021
dufoli pushed a commit that referenced this issue Feb 14, 2021
@dufoli dufoli closed this as completed Feb 14, 2021
@ppalaga ppalaga added this to the no fix/won't fix milestone Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

No branches or pull requests

5 participants