Hi,
I am trying to unmarshall a RosettaNet PO that I have mapped to a pretty
flat structure and I am getting the following error while unmarshalling
(with debug):
#startElement: LineNumber
#characters: 1
#endElement: LineNumber
java.lang.NullPointerException
at
org.exolab.castor.xml.UnmarshalHandler.endElement(UnmarshalHandler.ja
va:900)
at
org.exolab.castor.xml.UnmarshalHandler.endElement(UnmarshalHandler.ja
va:1038)
at
org.apache.xerces.parsers.SAXParser.endElement(SAXParser.java:1403)
at
org.apache.xerces.validators.common.XMLValidator.callEndElement(XMLVa
lidator.java:1436)
at
org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.disp
atch(XMLDocumentScanner.java:1205)
at
org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentS
canner.java:381)
at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1035)
at
org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:605)
at
org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:513)
at POTestReq.main(POTestReq.java:32)
I am also set to IgnoreExtraElements.
Looking at the source, this error is happening while an exception message is
being constructed due to the fact that an element occured more than once.
I played a bit with the file but what seems to be happening is that I have
more that one field mapping that binds to the same name but at a different
location (this happens in many place in the file due to the way RosettaNet
has structured its element, and the exception can be triggered in other
areas as well).
Example:
<class name="com.hp.ibs.oneworld.placeorder.helper.PORequestLineItem">
<field name="parentItemNbr" type="string">
<bind-xml name="FreeFormText" location="comments"
node="element"/>
</field>
<field name="itemNbr" type="string">
<bind-xml name="LineNumber" location="DocumentLineReference"
node="element"/>
</field>
....
<field name="isDropShip" type="string">
<bind-xml name="AffirmationIndicator" location="isDropShip"
node="element"/>
</field>
<field name="lineNbr" type="string">
<bind-xml name="LineNumber" node="element"/>
</field>
Isn't a bind name unique by the combination of its location and name, or
simply its name?
How can I avoid this issue ?
Thanks for your help.
Alain Picard
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev