I have a sporadic unmarshalling problem using the following specific mapping
file:
<class name="test.addrBook.Port" auto-complete="true" >
</class>
<!-- Extended class mapping -->
<class name="test.addrBook.PortExt" auto-complete="false"
extends="test.addrBook.Port" >
<map-to xml="Port"/>
</class>
and my xml data are as follow:
<?xml version="1.0" encoding="UTF-8"?>
<Port>
<name>port1</name>
<number>12</number>
<type>3</type>
</Port>
When i unmarshal the xml data using this mappingg file, sometime
it works and a class PortExt is intanciated, and sometime it does
not work and a class Port is instanciated by error.
I have found a solution which avoid this problem, i have added the field
'map-to xml' in the description of the class Port. This added field is
strictly needless for my application, but solves the problem.
Hereafter, the new mapping solving the unmarsalling problem:
<class name="test.addrBook.Port" auto-complete="true" >
<map-to xml="Port_NotUsed"/>
</class>
<!-- Extended class mapping -->
<class name="test.addrBook.PortExt" auto-complete="false"
extends="test.addrBook.Port" >
<map-to xml="Port"/>
</class>
After debbuging in the castor source, i think it might be a bug but i am not
sure ?
Is there anyone to confirm that...
The only aim of this email is to point out this pecular unmarshalling
problem,
and help the users of castor xml.
Christian
<class name="test.addrBook.Port" auto-complete="true" >
<!-- Warning: this 'map-to xml' is needless for the XMS project,
-->
<!-- but needed to avoid an unmarshalling castor bug
-->
<!-- for the extended classes, which occurs
intermittenly.-->
<!-- Never remove this 'map-to xml' description !
-->
<map-to xml="Port_NotUsed"/>
</class>
<!-- Extended class mapping -->
<class name="test.addrBook.PortExt" auto-complete="false"
extends="test.addrBook.Port" >
<map-to xml="Port"/>
</class>
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev