Looks like the corresponding JIRA issue is CASTOR-1950 --
http://jira.codehaus.org/browse/CASTOR-1950.

It's classified as a "Bug" and the status is "Open", but Werner's latest
comment on it suggests that the problem might be in the attached XSD. Where
does this stand?

I've run into this problem, with the latest stable rls (1.1.2.1) and JDK
1.5. Should I post my XSD? If it's a bug, is there a workaround?

--aslam


Werner Guttmann wrote:
> 
> Hmm, I don't remember the changelog since 1.1 top off my head, but I
> think that we might have fixed the occasional issue with location of
> descriptor classes and/or import statements of these.
> 
> Nevertheless, I think that generating these classes is the right way to
> go, and if there's issues, I'd like to learn about them (in the form of
> e.g. a bug report).
> 
> Regards
> Werner
> 
> Raghavan Eachampadi wrote:
>> Initially, I did generate the descriptor classes.  The issue I
>> encountered was that the descriptor classes were generated in a package
>> like "com.xyz.descriptors" and there were many classes classes that were
>> generated in "com.xyz" package that were referring to the descritpor
>> classes in "com.xyz.descriptors" package without having the appropriate
>> import statements.  This was causing compilation errors.  For lack of
>> time, I circumvented this by not generating the descriptors.
>>  
>> Now, any idea why the classes do not have the necessary import
>> statements for the descriptor classes?  Am I missing something very
>> basic here?
>>  
>> Thanks for any help here...
>>  
>> Raghavan Eachampadi
>>  
>>  
>> 
>> ------------------------------------------------------------------------
>> *From:* Werner Guttmann [mailto:[EMAIL PROTECTED]
>> *Sent:* Tuesday, April 17, 2007 12:40 AM
>> *To:* [email protected]
>> *Subject:* AW: [castor-user] XML:Unmarshaller creates an empty java
>> object (all null values) - castor 1.1
>> 
>> 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
>> 
>>  
>> 
>>  
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
> 
>     http://xircles.codehaus.org/manage_email
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/XML%3AUnmarshaller-creates-an-empty-java-object-%28all-null-values%29---castor-1.1-tf3587316.html#a13177038
Sent from the Castor - User mailing list archive at Nabble.com.


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

    http://xircles.codehaus.org/manage_email

Reply via email to