Overiding a getter seems to cause a null pointer exception on marshalling.

With JDK 1.4, and castor-0.9.5.3-xml.jar, and the simplified classes at the
bottom of the post, I get the following exception:

java.lang.NullPointerException
        at
org.exolab.castor.xml.util.XMLClassDescriptorImpl.validate(XMLClassDescripto
rImpl.java:890)
        at org.exolab.castor.xml.Validator.validate(Validator.java:122)
        at org.exolab.castor.xml.Marshaller.validate(Marshaller.java:2068)
        at org.exolab.castor.xml.Marshaller.marshal(Marshaller.java:774)
        at org.exolab.castor.xml.Marshaller.marshal(Marshaller.java:674)
        at teststuff.Derived.main(Derived.java:17)
Exception in thread "main" 

If I set marshalling validation off in the castor.properties the problem
goes away.

org.exolab.castor.marshalling.validation=false


I had a brief step though the code.  Setting through validation code it
seems like the equals on properties may be wrong because both the thing in
derived and base appear and are categorized as inherited.


package teststuff;

public class Base {
    public String getThing() {
        return "base thing";
    }
}

package teststuff;

import java.io.PrintWriter;

import org.exolab.castor.xml.Marshaller;

public class Derived extends Base {
    public String getThing() {
        return "derived thing";
    }
    
    public static void main(String args[]) throws Exception {
        Marshaller.marshal(new Derived(), new PrintWriter(System.out));
    }
}



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

Reply via email to