Thanks Seb! It works fine now with your proposed changes.
Best regards
Lars
-----Original Message-----
From: S�bastien Gignoux [mailto:[EMAIL PROTECTED]]
Sent: den 11 juli 2002 11:28
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] Mapping file bug in Castor 0.9.3.19
You can try to change the Marshaller as follow: around line 950, you change
this:
//make sure we only run into this logic if the
classDescriptor
// is coming from a mapping file.
if (xmlElementNameClassDesc instanceof
XMLClassDescriptorAdapter) {
into
//make sure we only run into this logic if the
classDescriptor
//is coming from a mapping file.
if ((xmlElementNameClassDesc instanceof
XMLClassDescriptorAdapter) &&
(descriptor.getContainingClassDescriptor() != null)) {
This should remove the null pointer.
Then you will have to change your mapping to:
<mapping>
<class name="Meti" auto-complete="true">
<map-to xml="item" />
</class>
</mapping>
The auto-complete is important to tell Castor to find the field of the class
by itself. Else it will output no field because you specified any.
Keith/Arnaud: could you commit this change if it's fine for you?
Seb
-----Original Message-----
From: Lars Lindgren [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 11, 2002 10:16 AM
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] Mapping file bug in Castor 0.9.3.19
Hi!
If I marshall the Meti instance, i.e. item, instead of the Invoice instance,
i.e. invoice, the NullPointerException does not occur. So probably your
assumption is correct.
Thanks for your help!
Best regards
Lars
-----Original Message-----
From: S�bastien Gignoux [mailto:[EMAIL PROTECTED]]
Sent: den 11 juli 2002 10:09
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] Mapping file bug in Castor 0.9.3.19
Hi,
I reproduced your problem, here is the stack trace with the line numbers:
java.lang.NullPointerException
at org.exolab.castor.xml.Marshaller.marshal(Marshaller.java:953)
at org.exolab.castor.xml.Marshaller.marshal(Marshaller.java:1266)
at org.exolab.castor.xml.Marshaller.marshal(Marshaller.java:1270)
at org.exolab.castor.xml.Marshaller.marshal(Marshaller.java:721)
at Invoice.main(Invoice.java:54)
The problem seems to come from the fact that there is mapping information
for the class Meti but not for Invoice, its parent. I will try to look at it
more closely.
Seb
- }
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev
