I have been digging around in the source code and I think this is a bug
in the UnmarshallHandler class.  There is a count variable in the
startElement(String name, String namespace, AttributeSet atts) method
that seems to be causing some problems (the section of code in question
begins on line 1724 in the latest CVS version of the file).  I haven't
fully got my head around what this code is doing but this count variable
is being used in a couple of if statements and I don't think these
conditional blocks are always being executed when they need to be.

If I remove the line that increments the count (line 1812) I sort of
solve the problem.  I can then use the location and auto-naming
attributes together in my mapping file and everything works as I would
expect.  However, if I try to use more than one level in the location
attribute (i.e. location="wrapper1/wrapper2") the problem comes back.
Can anybody give me some more insight into this section of code so that
I can make the necessary changes to get it working properly?

Thanks,

Dan.


-----Original Message-----
From: Daniel Dyer 
Sent: 28 February 2005 13:34
To: 'castor-user@exolab.org'
Subject: "unable to find FieldDescriptor" when using auto-naming with
location attribute


Hi all, I have very nearly got Castor XML to do exactly what I want but
I have one last problem. When I use both auto-naming="deriveByClass" and
the location attribute

..

when I unmarshall the XML I get the error message "Unable to find
FieldDescriptor for 'myPolymorphicField' in ClassDescriptor of
location-element". 

If I take out either one of the auto-naming or location attributes from
the mapping file it works but then the XML does not validate against the
schema I am using. It's only when I use both together that I get the
error. 

Any ideas? I looked in Bugzilla and found this open bug
(http://bugzilla.exolab.org/show_bug.cgi?id=1512) but it doesn't seem to
be exactly the same thing. 

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to