jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • castor
  • CASTOR-1942

NPE in handleField line 1946 while processing <any> element

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major 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.

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. XML File
    saml-schema-protocol-2.0.xsd
    11/Apr/07 4:11 PM
    13 kB
    John G Griffith

Issue Links

duplicates

Bug - A problem which impairs or prevents the functions of the product. CASTOR-1938 NullPointerException for an extended type with xs:any

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
John G Griffith added a comment - 11/Apr/07 4:36 PM

This does not seem to an issue when using the trunk version. (SourceGenerator 6936)

Show
John G Griffith added a comment - 11/Apr/07 4:36 PM This does not seem to an issue when using the trunk version. (SourceGenerator 6936)
Hide
Permalink
Werner Guttmann added a comment - 12/Apr/07 4:33 AM

John, can you please ...

a) either attach the required XML schemas as included/imported, or
b) provide me with a minimal XML schema that showcases the problem at hand.

In addition, it might be that we have (quite recently) fixed a similar (if not the same) problem.

Show
Werner Guttmann added a comment - 12/Apr/07 4:33 AM John, can you please ... a) either attach the required XML schemas as included/imported, or b) provide me with a minimal XML schema that showcases the problem at hand. In addition, it might be that we have (quite recently) fixed a similar (if not the same) problem.
Hide
Permalink
Werner Guttmann added a comment - 12/Apr/07 5:01 AM

This is a duplicate of CASTOR-1938.

Show
Werner Guttmann added a comment - 12/Apr/07 5:01 AM This is a duplicate of CASTOR-1938.

People

  • Assignee:
    Werner Guttmann
    Reporter:
    John G Griffith
Vote (0)
Watch (1)

Dates

  • Created:
    11/Apr/07 4:11 PM
    Updated:
    20/Apr/07 10:23 AM
    Resolved:
    12/Apr/07 5:01 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.