You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a rather complex set of schema files.
The schema files can be grouped into 2 parts, one generic part A and one specific part B which reuses types from A.
As always, we use xjc to generate jaxb classes for part A and let xjc generate an episode file.
When generating the jaxb classes for part B we used that episode file in order to avoid duplicate class creation which works perfectly.
However, when looking into the ObjectFactory of part B, it suprisingly contains create methods for classes of part A and those create methods are already part of the ObjectFactory of part A.
As a result, when marshalling our JAXB tree, it fails with:
java.util.concurrent.CompletionException: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 3 counts of IllegalAnnotationExceptions
The element name {http://namespace/of/part/A has more than one mapping.
this problem is related to the following location:
at public javax.xml.bind.JAXBElement com.part.B.xml.ObjectFactory.createProblematicType(com.part.A.xml.ProblematicType)
When manually removing those redudant create methods from part B's ObjectFactory, everything works as expected.
Question:
Why does xjc create those duplicate create() methods?
(Note: jaxb 2.3.5 has been used)
The text was updated successfully, but these errors were encountered:
Hi there,
We have a rather complex set of schema files.
The schema files can be grouped into 2 parts, one generic part A and one specific part B which reuses types from A.
As always, we use xjc to generate jaxb classes for part A and let xjc generate an episode file.
When generating the jaxb classes for part B we used that episode file in order to avoid duplicate class creation which works perfectly.
However, when looking into the ObjectFactory of part B, it suprisingly contains create methods for classes of part A and those create methods are already part of the ObjectFactory of part A.
As a result, when marshalling our JAXB tree, it fails with:
When manually removing those redudant create methods from part B's ObjectFactory, everything works as expected.
Question:
Why does xjc create those duplicate create() methods?
(Note: jaxb 2.3.5 has been used)
The text was updated successfully, but these errors were encountered: