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
I'm working with an editor who provides us XSD schemas using "abstract" elements and "susbtituableGroups" keyword, and it seems to be a problem with this kind of usage using your org.eclipse.persistence.moxy JAXB Implementation.
Actually we use your last release version 4.0.1 but no matter using any versions 2.XX, 3.XX or 4.XX, we are facing a random NullPointerException while creating JaxbContext in your org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor class, updateGlobalElements method, Line 3985 (rootDeclaration is null).
"random" because it's not always the same XSD element concerned (but always a substituable element), and sometimes, very rarely, it can pass without NullPointerException.
Using debug mode, we can see that the variable "next" in method updateGlobalElements is an XSD element that has a abstract type as substitutionGroup defined in one XSD :
<xs:element name="the value of the 'next' variable" type="its_type" substitutionGroup="xxxx_abstract" /> (xxxx_abstract corresponds to the variable substitutionHead in method updateGlobalElements)
And in another XSD, we have the declaration of the abstract element :
<xs:element ref="xxxx_abstract" minOccurs="0" maxOccurs="unbounded" /> in a complex type (which is not the root type)
...
<xs:element name="xxxx_abstract" abstract="true" />
The problem is only when we create the JaxbContext using the root (@XmlRootElement annotation) element class generated from the XSDs. We don't reproduce it when we create the JaxbContext context using the package name of the generated model nor the generated ObjectFactory class.
To sum up :
JAXBContext.newInstance(myPackage.MyRootElement.class) ==> random NullPointerException
JAXBContext.newInstance(myPackage.ObjectFactory.class) ==> OK
JAXBContext.newInstance("myPackage") ==> OK
Generation of the model is done using XJC by a Jaxb maven plugin
Java 8 or Java 17 : no matter, we face the problem
It's on a spring boot API.
Thanks for your help
The text was updated successfully, but these errors were encountered:
Hello,
I'm working with an editor who provides us XSD schemas using "abstract" elements and "susbtituableGroups" keyword, and it seems to be a problem with this kind of usage using your org.eclipse.persistence.moxy JAXB Implementation.
Actually we use your last release version 4.0.1 but no matter using any versions 2.XX, 3.XX or 4.XX, we are facing a random NullPointerException while creating JaxbContext in your org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor class, updateGlobalElements method, Line 3985 (rootDeclaration is null).
"random" because it's not always the same XSD element concerned (but always a substituable element), and sometimes, very rarely, it can pass without NullPointerException.
Using debug mode, we can see that the variable "next" in method updateGlobalElements is an XSD element that has a abstract type as substitutionGroup defined in one XSD :
<xs:element name="the value of the 'next' variable" type="its_type" substitutionGroup="xxxx_abstract" /> (xxxx_abstract corresponds to the variable substitutionHead in method updateGlobalElements)
And in another XSD, we have the declaration of the abstract element :
<xs:element ref="xxxx_abstract" minOccurs="0" maxOccurs="unbounded" /> in a complex type (which is not the root type)
...
<xs:element name="xxxx_abstract" abstract="true" />
The problem is only when we create the JaxbContext using the root (@XmlRootElement annotation) element class generated from the XSDs. We don't reproduce it when we create the JaxbContext context using the package name of the generated model nor the generated ObjectFactory class.
To sum up :
JAXBContext.newInstance(myPackage.MyRootElement.class) ==> random NullPointerException
JAXBContext.newInstance(myPackage.ObjectFactory.class) ==> OK
JAXBContext.newInstance("myPackage") ==> OK
Generation of the model is done using XJC by a Jaxb maven plugin
Java 8 or Java 17 : no matter, we face the problem
It's on a spring boot API.
Thanks for your help
The text was updated successfully, but these errors were encountered: