Using castor 1.1.2.1 I am attempting to marshal an object generated via the
code generator to XML. If I do this withing my IDE it works fine. After
deploying this to our application server (Sybase EAServer 5.3 using Java
1.5.0_09) the same code fails with a NullPointerException. The following stack
trace is generated:
java.lang.NullPointerException
at
org.exolab.castor.xml.util.XMLClassDescriptorResolverImpl$DescriptorCache.loadMapping(XMLClassDescriptorResolverImpl.java:1032)
at
org.exolab.castor.xml.util.XMLClassDescriptorResolverImpl$DescriptorCache.loadPackageMapping(XMLClassDescriptorResolverImpl.java:942)
at
org.exolab.castor.xml.util.XMLClassDescriptorResolverImpl.getDescriptor(XMLClassDescriptorResolverImpl.java:505)
at
org.exolab.castor.xml.util.XMLClassDescriptorResolverImpl.resolve(XMLClassDescriptorResolverImpl.java:171)
at org.exolab.castor.xml.Validator.validate(Validator.java:111)
at org.exolab.castor.xml.Marshaller.validate(Marshaller.java:2527)
at org.exolab.castor.xml.Marshaller.marshal(Marshaller.java:824)
at org.exolab.castor.xml.Marshaller.marshal(Marshaller.java:730)
at com.dac.castorbindings.stp.REQUESTS.marshal(REQUESTS.java:67)
The REQUESTS object is the one I generated using the code generator. It
appears that inside the XMLClassDescriptorResolverImpl class the getClassLoader
method is returning null, but I am not sure why. This technique worked
correctly under castor 0.9.5.3 we are just finally getting around to upgrading.
Correctly marshalled output would look like this:
<?xml version="1.0" encoding="UTF-8"?>
<REQUESTS ActionCode="R">
<ADD>
<REQUEST_TRANSACTIONS PlanID="CAD0000000001"
EmployerIdentificationNumber="12345">
<TRANSACTIONS>
<TRANSACTION PlanID="CAD0000000001"
TransEffectiveDate="2005-01-08">
<TRANSACTION_GENERAL_INFO>
<PlanID>CAD0000000001</PlanID>
<YearEndDate>2005-12-31</YearEndDate>
<ConfirmRequiredCode tc="N" />
<ProcessEligEntrCode tc="Y" />
<ProcessEligCompCode tc="Y" />
<ProcessEligHCECode tc="N" />
<TransEffectiveDate>2005-01-08</TransEffectiveDate>
<TransTypeCode tc="13" />
<PostAllDivisionsCode tc="Y" />
</TRANSACTION_GENERAL_INFO>
</TRANSACTION>
</TRANSACTIONS>
</REQUEST_TRANSACTIONS>
</ADD>
</REQUESTS>
Any ideas?
Thanks,
Doug
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email