Is there any particular reason why you are *not* generating the descriptor classes where Castor maintains the XML to Java object binding information ? I know that Castor does support introspection during 'class descriptor resolution', but by not generating the class descriptors, you are basically instructing Castor not to use the most valuable piece of information (that has been derived from the original XML schema(s) during generation).
Werner ________________________________ Von: Raghavan Eachampadi [mailto:[EMAIL PROTECTED] Gesendet: Montag, 16. April 2007 23:18 An: [email protected] Betreff: [castor-user] XML:Unmarshaller creates an empty java object (all null values) - castor 1.1 Hi, I am using castor 1.1 with JDK 6. I've used the xml source generator to generate java classes for the XML schemas. I've used the option -nodesc in the source generator to not create any descriptor classes. Also, I do not have any mapping.xml file that I use. When I use the static method Unmarshaller.unmarshall() to create a java object from an xml document instance, I see that all the members fields of the instantiated object is null. Any pointers/help is greatly appreciated. Here is my code listing: try { Reader xmlReader = new FileReader(xmlInstance); /* xmlInstance is the String containing the xml file name that is being unmarshalled */ EntityDescriptor metaDataObj = (EntityDescriptor)(Unmarshaller.unmarshal(EntityDescriptor.class, xmlReader)); /* EntityDescriptor is the class corresponding to the root of the xml file being unmarshalled -- metaDataObj is a non null object but all its members are uninitialized (basically null) */ isValid = metaDataObj.isValid(); /* This method returns true */ } catch (FileNotFoundException fnfex) { throw fnfex; } catch (org.exolab.castor.xml.ValidationException vex) { throw vex; } catch (MarshalException mex) { throw mex; } Raghavan Eachampadi

