Stephen, Thanks for your input. Just found this thread from Nov 2004,
http://hypermail.linklord.com/castor-dev/2004/Aug/4794.html where an almost identical issue has been reported. Let's see whether somebody else has got to say anything about this. Werner > -----Original Message----- > From: Stephen Bash [mailto:[EMAIL PROTECTED] > Sent: Dienstag, 20. September 2005 16:44 > To: [email protected] > Subject: Re: [castor-user] [XML] Use of > auto-derive="byClassName" and location attribute > > Werner- > > The simultaneous use of any auto-naming attribute and the > location attribute was a known problem several versions ago > (I first ran into it in 0.9.5.4 and I think it persisted in > 0.9.6), but I'm not sure of the current status. > > A jira search comes up with lots of hits, but most of the > situations are slightly different, so it's hard to nail down > this exact problem. I also found several hits on the list > archives, and Keith has been in on several of the > conversations, so he might have the best idea of what is > going on currently. > > In the past I just had to change my mapping to work around > the problem. > Sorry I can't be more help. > > Stephen > > > Werner Guttmann wrote: > > Hi, > > > > Does anybody know whether Castor XML has problems with the > > simultaneous use of auto-derive="byClassName" and the location > > attribute ? In a class mapping, I have the following field mapping: > > > > <field name="bets" type="com.betandwin.abp.entity.bet.PlaceableBet" > > collection="collection"> > > <bind-xml auto-naming="deriveByClass" location="bets"/> </field> > > > > When trying to unmarshall anything really simple, I get an > exception > > such as > > > > unable to find FieldDescriptor for 'win' in ClassDescriptor of > > bets{file: [not available]; line: 1; column: 122} > > at > > org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:671) > > at > > > com.betandwin.servlet.TestBetSlipXML.testSimpleBetSlip(TestBetSlipXML. > > ja > > va:60) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j > > av > > a:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess > > or > > Impl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:324) > > at junit.framework.TestCase.runTest(TestCase.java:154) > > at junit.framework.TestCase.runBare(TestCase.java:127) > > at junit.framework.TestResult$1.protect(TestResult.java:106) > > at junit.framework.TestResult.runProtected(TestResult.java:124) > > at junit.framework.TestResult.run(TestResult.java:109) > > at junit.framework.TestCase.run(TestCase.java:118) > > at junit.framework.TestSuite.runTest(TestSuite.java:208) > > at junit.framework.TestSuite.run(TestSuite.java:203) > > at > > > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remote > > Te > > stRunner.java:478) > > at > > > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestR > > un > > ner.java:344) > > at > > > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTest > > Ru > > nner.java:196) > > Caused by: org.xml.sax.SAXException: unable to find FieldDescriptor > > for 'win' in ClassDescriptor of bets > > at > > > org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.j > > av > > a:1940) > > at > > > org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.j > > av > > a:1388) > > at > > > org.apache.xerces.parsers.AbstractSAXParser.startElement(Unkno > wn Source) > > at > > > org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unkno > > wn > > Source) > > at > > > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement > > (U > > nknown Source) > > at > > > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentD > > is > > patcher.dispatch(Unknown Source) > > at > > > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unk > > no > > wn Source) > > at org.apache.xerces.parsers.XML11Configuration.parse(Unknown > > Source) > > at org.apache.xerces.parsers.XML11Configuration.parse(Unknown > > Source) > > at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) > > at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown > > Source) > > at > > org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:657) > > ... 16 more > > Caused by: org.xml.sax.SAXException: unable to find FieldDescriptor > > for 'win' in ClassDescriptor of bets > > at > > > org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.j > > av > > a:1940) > > at > > > org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.j > > av > > a:1388) > > at > > > org.apache.xerces.parsers.AbstractSAXParser.startElement(Unkno > wn Source) > > at > > > org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unkno > > wn > > Source) > > at > > > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement > > (U > > nknown Source) > > at > > > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentD > > is > > patcher.dispatch(Unknown Source) > > at > > > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unk > > no > > wn Source) > > at org.apache.xerces.parsers.XML11Configuration.parse(Unknown > > Source) > > at org.apache.xerces.parsers.XML11Configuration.parse(Unknown > > Source) > > at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) > > at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown > > Source) > > at > > org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:657) > > at > > > com.betandwin.servlet.TestBetSlipXML.testSimpleBetSlip(TestBetSlipXML. > > ja > > va:60) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j > > av > > a:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess > > or > > Impl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:324) > > at junit.framework.TestCase.runTest(TestCase.java:154) > > at junit.framework.TestCase.runBare(TestCase.java:127) > > at junit.framework.TestResult$1.protect(TestResult.java:106) > > at junit.framework.TestResult.runProtected(TestResult.java:124) > > at junit.framework.TestResult.run(TestResult.java:109) > > at junit.framework.TestCase.run(TestCase.java:118) > > at junit.framework.TestSuite.runTest(TestSuite.java:208) > > at junit.framework.TestSuite.run(TestSuite.java:203) > > at > > > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remote > > Te > > stRunner.java:478) > > at > > > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestR > > un > > ner.java:344) > > at > > > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTest > > Ru > > nner.java:196) > > > > > > When changing above field mapping to > > > > <field name="bets" type="com.betandwin.abp.entity.bet.PlaceableBet" > > collection="collection"> > > <bind-xml auto-naming="deriveByClass" /> </field> > > > > The exception is not thrown anymore, and Castor is successful in > > unmarshalling what it previously marshalled. > > > > Any idea what's going wrong ? > > > > Thanks > > Werner > > > > ------------------------------------------------- > > If you wish to unsubscribe from this list, please send an empty > > message to the following address: > > > > [EMAIL PROTECTED] > > ------------------------------------------------- > > > > > > ------------------------------------------------- > If you wish to unsubscribe from this list, please send an > empty message to the following address: > > [EMAIL PROTECTED] > ------------------------------------------------- > > > ------------------------------------------------- If you wish to unsubscribe from this list, please send an empty message to the following address: [EMAIL PROTECTED] -------------------------------------------------

