Bug filed: http://bugzilla.exolab.org/show_bug.cgi?id=1538
-----Original Message----- From: Keith Visco [mailto:[EMAIL PROTECTED] Sent: Saturday, February 14, 2004 3:55 AM To: [EMAIL PROTECTED] Subject: Re: [castor-dev] Help with xsi:type David, Can you file a bug report (http://bugzilla.exolab.org) and attach your test case so that I can take a look at the problem first hand. Thanks, --Keith David Hooker wrote: > > Yes I did that before I generated the classes. > > I narrowed this down to ClassDescriptorResolverImpl.resolveByXMLName(). > When it's trying to resolve the type ("SomeType" in the example below) > it can't find it in the caches or the mapping loader (I don't have a > mapping file at all), so it returns null. The UnmarshalHandler then > uses the "current package" which has the base class (which has the same > name, "SomeType", just in a different package). The base class doesn't > have the tagFred and tagWilma members, thus the exception. > > After thinking about it, I'm guessing that this is the correct behavior > for Castor. The Unmarshaller has no way to automatically map namespaces > to packages. So, is there a way to define these mappings for the > unmarshaller in a mappings file? Even after reading the docs I'm not > sure how to do that. > > -----Original Message----- > From: Keith Visco [mailto:[EMAIL PROTECTED] > Sent: Tuesday, February 10, 2004 1:34 AM > To: [EMAIL PROTECTED] > Subject: Re: [castor-dev] Help with xsi:type > > David, > > Did you map these in namespaces -to- packages in the castor.properties > so that Castor could find the correct package? > > --Keith > > David Hooker wrote: > > > More information about my problem... > > > > I'm working with two namespaces here, generated using the Castor XML > > Source Generator. In generating the source, I mapped the two > > namespace URI's to two packages. Apparently, some of the types in one > > > package inherit from types in the other package. > > > > Using the sample below, suppose I have a namespace called "ns", and > > another namespace called "base". I have a type SomeType in ns which > > inherits from the same named type in "base". Now, "someTag" below > > resolves to the base namespace, but the xsi:type references the > > derived type. However, Castor *incorrectly *resolves the name > > SomeType to the /base/ type instead of the derived type... therefore > > correctly saying that it can't find a descriptor for tagFred. > > > > This looks like a bug. What do I need to do to help get it fixed? > > > > -----Original Message----- > > *From:* David Hooker [mailto:[EMAIL PROTECTED] > > *Sent:* Monday, February 09, 2004 3:08 PM > > *To:* [EMAIL PROTECTED] > > *Subject:* [castor-dev] Help with xsi:type > > > > I have an XML file with an element that has something like this: > > > > <someTag xsi:type="ns:SomeType> > > <ns:tagFred>stuff</ns:tagFred> > > <ns:tagWilma>more stuff</ns:tagWilma> > > </someTag> > > > > > > When I try to unmarshal, this XML causes this error: > > > >org.xml.sax.SAXException: unable to find FieldDescriptor for 'tagFred' > in ClassDescriptor of SomeType > > at > org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.jav > a:1566) > > at > org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.jav > a:1149) > > at > org.apache.xerces.parsers.SAXParser.startElement(SAXParser.java:1376) > > > > > > Any clues? > > > > > > > > ----------------------------------------------------------- > If you wish to unsubscribe from this mailing, send mail to > [EMAIL PROTECTED] with a subject of: > unsubscribe castor-dev > > ----------------------------------------------------------- > If you wish to unsubscribe from this mailing, send mail to > [EMAIL PROTECTED] with a subject of: > unsubscribe castor-dev ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev
