Hi,

I was happy with Castor until I went mad about a silly error while
unmarshalling  using a simply schema.
Here is the part of schema that causes the problem:

 <xs:element name="Response">
  <xs:complexType>
   <xs:all maxOccurs="unbounded">
    <xs:element ref="MessageList"/>
   </xs:all>
  </xs:complexType>
 </xs:element>


 <xs:element name="MessageList">
  <xs:complexType>
   <xs:all maxOccurs="unbounded">
    <xs:element ref="ListItem"/>
   </xs:all>
  </xs:complexType>
 </xs:element>

 <xs:element name="ListItem">
  <xs:complexType>
   <xs:all>
    <xs:element ref="MessageId"/>
    <xs:element ref="FAD"/>
    <xs:element ref="MessageNumber"/>
   </xs:all>
  </xs:complexType>
 </xs:element>

And the code geneated by Castor works fine and marshalling is ok. But when I
try to unmarshall it it gives the  following error:

java.lang.NullPointerException
 at
org.exolab.castor.xml.util.XMLClassDescriptorImpl.getFieldDescriptor(Unknown
Source)
 at org.exolab.castor.xml.UnmarshalHandler.startElement(Unknown Source)
 at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
 at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unkno
wn Source)
 at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatc
her.dispatch(Unknown Source)
 at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
 at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
 at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
 at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
 at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
 at org.exolab.castor.xml.Unmarshaller.unmarshal(Unknown Source)
 at org.exolab.castor.xml.Unmarshaller.unmarshal(Unknown Source)
 at org.exolab.castor.xml.Unmarshaller.unmarshal(Unknown Source)
 at a.Response.unmarshal(Response.java:179)
 at a.xmlclient.PostManFrame$XmlInputListener.run(PostManFrame.java:255)

I could not do anything with it even if I played with my schema. I think
there is a problem about the intermediate class that Castor generated called
MessageListItem.java and its descriptor. Maybe it look for a
"<MessageListItem>" tag and could not find it and throws a nullpointer. This
is just a guess.

Can any one help me? By the way, I am using castor 0.9.3.21.

Thanx,

Tankut Koray

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to