Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

After examining the PUT source generated during this error, as revealed by Firebug, I saw that three groups/lists didn't have all their fields included.  I examined the code for these. The first, nagpraClaimNoteList, a repeating note field, had code identical to another (working) repeating notes field (comments in collectionobject). The second, sentToOversightCommitteeGroup, had code identical to another (working) group in nagpraclaim.  This second group was, however, inadvertently duplicated in the nagpraclaims_anthropology.xsd schema (it should only be in the nagpraclaims_pahma.xsd schema).  Removing it did not resolve the error.  The third field, recommendationOfOversightCommitteeGroup, also had code identical to another (working) group in nagpraclaim.

Solution: unknown.

Resolved: Variants of "Status:400:Create request failed: javax.ejb.EJBException: java.lang.NullPointerException"

As I understand it, the NullPointerException error indicates that something (e.g., name) is wrong with a (field) name somewhere in a schema, resulting in it not being found when it is needed.  What follows is a selection of some of the different causes of this annoyingly vague error message.

Resolved: "Status:400:Create request failed: javax.ejb.EJBException: java.lang.NullPointerException" in nagpraclaim

Status: Resolved.
Scope: This specific incident involved nagpraclaim only, but potentially any service with schema extensions could be affected.

Cause: I made an incomplete change to code during debugging.  A field in nagpraclaims_anthropology.xsd (nagpraClaimNoteList — a repeating note field) was defined with this codeAron pointed me to the collectionspace.log, which contained the following line:

Code Block

2011-10-06 11:42:42,463 DEBUG \[org.collectionspace.services.common.document.DocumentUtils\] Invalid input document. No such property was found nagpraClaimNoteList in schema nagpraclaims_common

This indicates to me that I hadn't properly pointed the field to the proper schema in our-tenant-tenant.xml.  And indeed, this is what I found in our-tenant-tenant.xml:

Code Block

    <repeat id="nagpraClaimNoteList">
        <field id="nagpraClaimNote"></field>
    </repeat>

I changed this to the following and am redeploying and rebuilding to see if this resolves the error:

Code Block

    <repeat id="nagpraClaimNoteList" section="anthropology">
        <field id="nagpraClaimNote" section="anthropology"></field>
    </repeat>

The above did not fix the error.
Solution: unknown.

...

Resolved: Variants of "Status:400:Create request failed: javax.ejb.EJBException: java.lang.NullPointerException"

As I understand it, the NullPointerException error indicates that something (e.g., name) is wrong with a (field) name somewhere in a schema, resulting in it not being found when it is needed.  What follows is a selection of some of the different causes of this annoyingly vague error message.

Resolved: "Status:400:Create request failed: javax.ejb.EJBException: java.lang.NullPointerException" in nagpraclaim

Status: Resolved.
Scope: This specific incident involved nagpraclaim only, but potentially any service with schema extensions could be affected.

Cause: I made an incomplete change to code during debugging.  A field in nagpraclaims_anthropology.xsd (nagpraClaimNoteList — a repeating note field) was defined with this code:

Code Block

    <xs:element name="nagpraClaimNoteList" type="nagpraClaimNoteList"/>

    <xs:complexType name="nagpraClaimNoteList">
        <xs:sequence>
            <xs:element name="nagpraClaimNote" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>

A similar (working) field in collectionobject had this code in collectionobjects_common.xsd:

Code Block
    <xs:element name="nagpraClaimNoteList" type="nagpraClaimNoteList"/comments">
        <xs:complexType name="nagpraClaimNoteList">complexType>
            <xs:sequence>
                <xs:element name="nagpraClaimNotecomment" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>

...


    </xs:element>

I revised this to the following and redeployed in an attempt to fix another error, but inadvertently left the initial line untouched:

Code Block
    <xs:element name="comments="nagpraClaimNoteList" type="nagpraClaimNoteList"/>

    <xs:element name="nagpraClaimNoteList">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="commentnagpraClaimNote" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

I revised this to the following and redeployed in an attempt to fix another error, but inadvertently left the initial line untouched:

Code Block
    </xs:element>

Having both <xs:element

...

name lines in triggered the java.lang.NullPointerException error.

Solution: Revise the element definition to be only:

Code Block
     <xs:element name="nagpraClaimNoteList">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="nagpraClaimNote" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

Having both <xs:element name lines in triggered the java.lang.NullPointerException error.

Solution: Revise the element definition to be onlywhich works, but which Aron tells me is deprecated, or the newer, apparently better "venetian blind" format:

Code Block
    <xs:element name="nagpraClaimNoteList">
  type="nagpraClaimNoteList"/>

     <xs:complexType>
complexType name="nagpraClaimNoteList">
           <xs:sequence>
                <xs:element name="nagpraClaimNote" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

...

Resolved: "Status:400:Create request failed: javax.ejb.EJBException: java.lang.NullPointerException" in collectionobject

...