Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Duplicate
-
Affects Version/s: 1.1
-
Fix Version/s: 1.1.1
-
Component/s: XML code generator
-
Labels:None
-
Environment:-i saml-schema-protocol-2.0.xsd -dest H:\Castor -verbose -types j2
Java 1.5, Castor 1.1
Description
While processing an <any> element, handleField throws an NPE at line 1946. Associated element (from SAML 2.0 Protocol XSD) is:
<element name="ArtifactResponse" type="samlp:ArtifactResponseType"/>
<complexType name="ArtifactResponseType">
<complexContent>
<extension base="samlp:StatusResponseType">
<sequence>
<any namespace="##any" processContents="lax" minOccurs="0"/>
</sequence>
</extension>
</complexContent>
</complexType>
NPE is thrown while processing the <any> in the ArtifactResponseType element.
---------------------------------------------
java.lang.NullPointerException
at org.exolab.castor.builder.SourceFactory.handleField(SourceFactory.java:1946)
at org.exolab.castor.builder.SourceFactory.processContentModel(SourceFactory.java:1837)
at org.exolab.castor.builder.SourceFactory.processContentModel(SourceFactory.java:1805)
at org.exolab.castor.builder.SourceFactory.processComplexType(SourceFactory.java:1725)
at org.exolab.castor.builder.SourceFactory.processComplexType(SourceFactory.java:646)
at org.exolab.castor.builder.SourceFactory.createSourceCode(SourceFactory.java:342)
at org.exolab.castor.builder.SourceFactory.processComplexType(SourceFactory.java:610)
at org.exolab.castor.builder.SourceFactory.createSourceCode(SourceFactory.java:342)
at org.exolab.castor.builder.SourceGenerator.createClasses(SourceGenerator.java:835)
at org.exolab.castor.builder.SourceGenerator.generateAllClassFiles(SourceGenerator.java:691)
at org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenerator.java:655)
at org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenerator.java:598)
at org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenerator.java:503)
at org.exolab.castor.builder.SourceGeneratorMain.main(SourceGeneratorMain.java:284)
--------------------------------
It appears that the code assumes that fieldInfo.getNodeName() returns a non-null value, and there is no XML node name for the wildcard element. As a result, baseNodeName is null.
Issue Links
- duplicates
-
CASTOR-1938
NullPointerException for an extended type with xs:any
-
This does not seem to an issue when using the trunk version. (SourceGenerator 6936)