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 3.0.0.Alpha6] IllegalAnnotationsException Two classes have the same XML type name thrown at build time by quarkus-jaxb #4603

Closed
jamesnetherton opened this issue Feb 27, 2023 · 5 comments · Fixed by #4678
Assignees
Milestone

Comments

@jamesnetherton
Copy link
Contributor

Something must have changed in Quarkus JAXB because all of the CXF SOAP tests fail with similar Two classes have the same XML type issues like this:

java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
        [error]: Build step io.quarkus.jaxb.deployment.JaxbProcessor#setupJaxbContextConfig threw an exception: java.lang.IllegalStateException: Failed to configure JAXB context
        at io.quarkus.jaxb.deployment.JaxbProcessor.validateContext(JaxbProcessor.java:392)
        at io.quarkus.jaxb.deployment.JaxbProcessor.setupJaxbContextConfig(JaxbProcessor.java:317)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:909)
        at io.quarkus.builder.BuildContext.run(BuildContext.java:282)
        at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
        at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
        at java.base/java.lang.Thread.run(Thread.java:833)
        at org.jboss.threads.JBossThread.run(JBossThread.java:501)
Caused by: org.glassfish.jaxb.runtime.v2.runtime.IllegalAnnotationsException: 47 counts of IllegalAnnotationExceptions
Two classes have the same XML type name "{http://www.w3.org/2000/09/xmldsig#}ObjectType". Use @XmlType.name and @XmlType.namespace to assign different names to them.
        this problem is related to the following location:
                at org.apache.cxf.ws.security.sts.provider.model.xmldsig.ObjectType
        this problem is related to the following location:
                at org.apache.xml.security.binding.xmldsig.ObjectType
                at public jakarta.xml.bind.JAXBElement org.apache.xml.security.binding.xmldsig.ObjectFactory.createObject(org.apache.xml.security.binding.xmldsig.ObjectType)
                at org.apache.xml.security.binding.xmldsig.ObjectFactory
                at protected java.util.List org.apache.xml.security.binding.xmldsig.TransformType.content
                at org.apache.xml.security.binding.xmldsig.TransformType
                at protected java.util.List org.apache.xml.security.binding.xmlenc.TransformsType.transform
                at org.apache.xml.security.binding.xmlenc.TransformsType
                at public org.apache.xml.security.binding.xmlenc.TransformsType org.apache.xml.security.binding.xmlenc.ObjectFactory.createTransformsType()
                at org.apache.xml.security.binding.xmlenc.ObjectFactory

@ppalaga
Copy link
Contributor

ppalaga commented Feb 27, 2023

It looks like CXF 4 does not depend on santuario:xmlsec anymore. So quarkus-cxf should also stop depending on Qverse xmlsec. This is surely reproducible also in Qverse CXF.

@ppalaga
Copy link
Contributor

ppalaga commented Feb 27, 2023

Blocked by quarkiverse/quarkus-cxf#730

@ppalaga
Copy link
Contributor

ppalaga commented Mar 7, 2023

It looks like CXF 4 does not depend on santuario:xmlsec anymore. So quarkus-cxf should also stop depending on Qverse xmlsec.

No, this is not true. The santuario:xmlsec dependecy is still there, although now it is transitive.

jamesnetherton added a commit to jamesnetherton/camel-quarkus that referenced this issue Mar 8, 2023
@jamesnetherton
Copy link
Contributor Author

Just a heads up - in order to upgrade to Quarkus 3.0.0.Alpha5, I had to disable the cxf-soap test bits in c8a4adb.

@ppalaga ppalaga changed the title [Quarkus 3.0.0.CR1] CXF SOAP integration test failures [Quarkus 3.0.0.CR1] IllegalAnnotationsException Two classes have the same XML type name thrown at build time by quarkus-jaxb Mar 9, 2023
@ppalaga
Copy link
Contributor

ppalaga commented Mar 9, 2023

There is a proper fix in Quarkus main branch that did not make it to 3.0.0.Alpha5: quarkusio/quarkus#31666

With Quarkus 3.0.0.Alpha5 this issue can be worked around by putting quarkus.jaxb.validate-jaxb-context=false into application.properties. Let me prepare a PR.

ppalaga added a commit to ppalaga/camel-quarkus that referenced this issue Mar 12, 2023
ppalaga added a commit to ppalaga/camel-quarkus that referenced this issue Mar 12, 2023
…classes

have the same XML type name thrown at build time by quarkus-jaxb
ppalaga added a commit that referenced this issue Mar 13, 2023
ppalaga added a commit that referenced this issue Mar 13, 2023
have the same XML type name thrown at build time by quarkus-jaxb
ppalaga added a commit to ppalaga/camel-quarkus that referenced this issue Mar 21, 2023
@ppalaga ppalaga changed the title [Quarkus 3.0.0.CR1] IllegalAnnotationsException Two classes have the same XML type name thrown at build time by quarkus-jaxb [Quarkus 3.0.0.Alpha6] IllegalAnnotationsException Two classes have the same XML type name thrown at build time by quarkus-jaxb Mar 21, 2023
@ppalaga ppalaga added this to the 3.0.0-M2 milestone Mar 21, 2023
zbendhiba pushed a commit that referenced this issue Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants