Java Mailing List Archive

http://www.junlu.com/

Home » user.castor »

[castor-user] [upgrade 0.9.x -> 1.3.2] unmarshalling fails

Papendieck, Thomas

2012-06-22

Replies: Find Java Web Hosting

Author LoginPost Reply
Hello,

my application used castor-xml 0.9.x for a long time.

I decided t upgrade to 1.3.2.
So I regenerated my castor-classes with castor-xml-codegen-1.3.2 and Java-7 and added the castor-xml-1.3.2 jars to my projekt.

This is the DOS-CMD-line used to generate the castor classes:
"%JDK_HOME%\bin\java" -classpath %CP% org.exolab.castor.builder.SourceGenerator -i %DTD_DIR%\%INTERFACE_NAME%.xsd -package %JAVA_PACKAGE% -dest generated_sources/%INTERFACE_NAME%

As you ca see it's used for more than one project. This one is the first to be upgraded. That's why I'd like to keep the old generator call untill I know the new version workes well...

Unfortunately the unmarshaller does not create object tree as expected. I get the an empty ParadIni object. No exception is thrown. Castor logs some warnings:

22.Jun.2012 09:25:18 [WARN ] StartElementProcessor:StartElementProcessor.compute(): Unable to find FieldDescriptor for 'Used_Interface_Flag' in ClassDescriptor of null.
22.Jun.2012 09:25:18 [INFO ] EndElementProcessor:EndElementProcessor.compute(): Ignoring Used_Interface_Flag no descriptor was found
22.Jun.2012 09:25:18 [WARN ] StartElementProcessor:StartElementProcessor.compute(): Unable to find FieldDescriptor for 'Bootloader_Path_Table' in ClassDescriptor of null.
22.Jun.2012 09:25:18 [INFO ] EndElementProcessor:EndElementProcessor.compute(): Ignoring Bootloader_Path_Table no descriptor was found
...

I attached the DTD, a valid XML and a jar containig the generated classes.

the Line to unmarshall is this:
Reader reader = new FileReader(_fileName);
ParadIni paradIni = (ParadIni) Unmarshaller.unmarshal(ParadIni.class, reader);

What am I doing wrong?
How can I bring castor-xml-1.3.2 to work?

bye
Thomas
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<ParadIni>
 <Used_Interface_Flag>2</Used_Interface_Flag>
 <Bootloader_Path_Table/>
 <Sortorder>
   <Table>
     <Name>Table1</Name>
     <Columns/>
   </Table>
 </Sortorder>
 <KLine>
   <Baudrate>115200</Baudrate>
   <Used_Comport>1</Used_Comport>
   <Operatingfrequency>60</Operatingfrequency>
 </KLine>
 <Can>
   <Proj_Can_Config_File_Path/>
   <Can_Config_File_Path/>
 </Can>
 <Flex>
   <Flex_Config_File_Path/>
 </Flex>
 <DividerLocations>
   <ParameterFormDivider>221</ParameterFormDivider>
 </DividerLocations>
</ParadIni>
<?xml version="1.0" encoding="iso-8859-1"?>
<!ELEMENT Bootloader_Id (#PCDATA)>
<!ELEMENT Path (#PCDATA)>
<!ELEMENT Can_Config_File_Path (#PCDATA)>
<!ELEMENT FlexConfigFilePath (#PCDATA)>
<!ELEMENT Proj_Can_Config_File_Path (#PCDATA)>
<!ELEMENT Used_Comport (#PCDATA)>
<!ELEMENT Operatingfrequency (#PCDATA)>
<!ELEMENT Used_Interface_Flag (#PCDATA)>
<!ELEMENT Baudrate (#PCDATA)>
<!ELEMENT Name (#PCDATA)>
<!ELEMENT Nr (#PCDATA)>
<!ELEMENT Direction (#PCDATA)>
<!ELEMENT Username (#PCDATA)>
<!ELEMENT LastSearchPath (#PCDATA)>
<!ELEMENT Filename (#PCDATA)>
<!ELEMENT VehicleFormDivider (#PCDATA)>
<!ELEMENT ParameterFormDivider (#PCDATA)>

<!ELEMENT KLine (
  Baudrate
, Used_Comport?
, Operatingfrequency?
)>
<!ELEMENT Can (
  Proj_Can_Config_File_Path?
, Can_Config_File_Path?
)>
<!ATTLIST Can
Identifier (CAN|VN7600_CAN1|VN7600_CAN2|VN7600_CAN3|VN7600_CAN4) "CAN"
viaUsb (true|false) "false"
>


<!ELEMENT Flex (
 FlexConfigFilePath?
)>

<!ELEMENT Bootloader_Path_Table (Bootloader_Path*)>
<!ELEMENT Bootloader_Path (Bootloader_Id, Path)>

<!ELEMENT Sortorder (Table+)>
<!ELEMENT Table (Name, Columns)>
<!ELEMENT Columns (Column*)>
<!ELEMENT Column (Nr, Direction)>

<!ELEMENT LastOpenedFiles (Filename*)>

<!ELEMENT DividerLocations (VehicleFormDivider?,ParameterFormDivider?)>

<!ELEMENT ParadIni (
  Used_Interface_Flag
, Bootloader_Path_Table?
, Sortorder
, Username?
, LastSearchPath?
, LastOpenedFiles?
, DividerLocations?
, KLine
, Can
, Flex)>







Attachment: cid:c3b9815d-eb75-453b-bb45-5f639d7aa28a (zipped)

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email
©2008 junlu.com - Jax Systems, LLC, U.S.A.