Sorry for being so slow on the uptake in so many things.

I've modified my source to get castor to print debug info and I'm making
sure I'm using 0.9.7 of castor

This is my unmarshalling function

  static Document getDocumentFromFile(String inputfileFullpath)
      throws java.io.FileNotFoundException,
      java.lang.ClassNotFoundException,
      org.exolab.castor.xml.MarshalException,
      org.exolab.castor.xml.ValidationException
  {
    java.io.Reader readDoc = new FileReader(inputfileFullpath);
    Class documentClass =
Class.forName("com.taxware.api.document.Document");
    Document doc = null;
    readDoc = new FileReader(inputfileFullpath);
    Unmarshaller u = new Unmarshaller(documentClass);
    u.setDebug(true);
    doc = (Document) u.unmarshal(readDoc);
    return doc;
  }
 
This is the trivial document object I'm trying to unmarshall:
---
<document>
    <currency>USF</currency>
    <transactionDocumentNumber>1234</transactionDocumentNumber>
</document>
---


com.taxware.api.document.Document contains 

    private String transactionDocumentNumber;
    private String currency;

as member variables and then basic setters and getters:

    public void setTransactionDocumentNumber(String s)
    {
        transactionDocumentNumber = s;
    }

    public String getTransactionDocumentNumber()
    {
        return transactionDocumentNumber;
    }
    public void setCurrency(String s)
    {
        currency = s;
    }

    public String getCurrency()
    {
        return currency;
    }



The output is
---
#startElement: document
#characters:

#startElement: currency
#characters: USF
#endElement: currency
#characters:

#startElement: transactionDocumentNumber
unable to find FieldDescriptor for 'transactionDocumentNumber' in
ClassDescriptor of document
#characters: 1234
#endElement: transactionDocumentNumber
Ignoring transactionDocumentNumber no descriptor was found
java.lang.NullPointerException
        at
org.exolab.castor.xml.UnmarshalHandler.endElement(UnmarshalHandler.java:
763)
        at
org.exolab.castor.xml.UnmarshalHandler.endElement(UnmarshalHandler.java:
1134)
---


but if I leave out 
    <transactionDocumentNumber>1234</transactionDocumentNumber>
it works fine; currency gets processed no problem but I don't know what
the fundamental differences between "setCurrency(String s)" and
"setTransactionDocumentNumber(String s)"

Any idea? Should I try inspecting Class on my own, see if I'm getting
some wacky version of it?





-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

Reply via email to