Uwe, can you please create a new issue at
http://jira.codehaus.org/browse/CASTOR and attach all relevant files ? Regards Werner Langbecker, Uwe wrote: > Hi, > > in the recent version 1.1 there is a change in behaviour for references > to classes with id. > As a result, a mapping that was working before (e.g. in version 1.0.5) > causes an exception. > Here is sample mapping: > > <?xml version="1.0"?> > <mapping> > > <class name="sample.Identifiable" > verify-constructable="false" identity="id"> > <map-to xml="Identifiable" /> > <field name="id" type="string"> > <bind-xml name="id" node="attribute" /> > </field> > </class> > > <class name="sample.Person" extends="sample.Identifiable" > > <map-to xml="Person" /> > <field name="name" type="string"> > <bind-xml name="name" node="attribute" /> > </field> > </class> > > <class name="sample.Department"> > <map-to xml="Department" /> > <field name="members" type="sample.Person" > collection="arraylist"> > <bind-xml name="members" node="attribute" > reference="true"/> > </field> > </class> > > </mapping> > > Previously, the mapping led to > > <?xml version="1.0" encoding="UTF-8"?> > <Department members="id-1 id-2"/> > > but in the recent version, the following exception is thrown. > > Unable to resolve ID for instance of class 'sample.Person' due to the > following error: No identity descriptor available > at > org.exolab.castor.xml.Marshaller.getObjectID(Marshaller.java:2018) > at > org.exolab.castor.xml.Marshaller.processAttribute(Marshaller.java:2292) > at > org.exolab.castor.xml.Marshaller.marshal(Marshaller.java:1351) > at org.exolab.castor.xml.Marshaller.marshal(Marshaller.java:840) > at > sample.CastorMappingIdTest.testCompatibility_2(CastorMappingIdTest.java: > 59) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown > Source) > at java.lang.reflect.Method.invoke(Unknown Source) > 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.junit3.JUnit3TestReference.run(JUn > it3TestReference.java:128) > at > org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.ja > va:38) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTe > stRunner.java:460) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTe > stRunner.java:673) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRun > ner.java:386) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRu > nner.java:196) > > The complete test case is attached. Mapping file map1.xml gives the > expected result, while map2.xml fails. > > Best regards, > Uwe > > > > This e-mail and any attachment thereto may contain confidential information > and/or information protected by intellectual property rights for the > exclusive attention of the intended addressees named above. Any access of > third parties to this e-mail is unauthorised. Any use of this e-mail by > unintended recipients such as total or partial copying, distribution, > disclosure etc. is prohibited and may be unlawful. When addressed to our > clients the content of this e-mail is subject to the General Terms and > Conditions of GL's Group of Companies applicable at the date of this e-mail. > > If you have received this e-mail in error, please notify the sender either by > telephone or by e-mail and delete the material from any computer. > > GL's Group of Companies does not warrant and/or guarantee that this message > at the moment of receipt is authentic, correct and its communication free of > errors, interruption etc. > > > ------------------------------------------------------------------------ > > --------------------------------------------------------------------- > To unsubscribe from this list please visit: > > http://xircles.codehaus.org/manage_email --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email

