Can you please

a) have a look at the release notes for Castor 1.1.1, as I think we
might have fixed a bug in this area (not sure, though).
b) try to add identity attributes to all relevant class mappings.

If that does not help either, or you do not like this mode, feel free to
raise a new issue at

http://jira.codehaus.org/browse/CASTOR

and attach all relevant files.

Werner

Marija Susović wrote:
> I'm using castor  version 1.1. I'll try to add identity attributes to
> all class mappings.
> Thanks,
> 
> Marija
> 
> On 5/25/07, *Werner Guttmann* < [EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>> wrote:
> 
>     What version of Castor are you using ? And without having looked into
>     details (yet), I think adding identity="..." attributes to all class
>     mappings might help.
> 
>     Werner
> 
>     Marija Susović wrote:
>     > Hi!
>     >
>     > I have a problem with identity descriptor. My object model is like
>     this:
>     >
>     > public abstract class BaseClass{
>     >
>     >     private Integer id;
>     >     ...
>     >     //getters and setters
>     > }
>     >
>     > public abstract class IntermediaryClass extends BaseClass{
>     >
>     >     ...
>     > }
>     >
>     > public class AClass extends IntermediaryClass{
>     >
>     >     private  String member1;
>     >     ...
>     >     //getters and setters
>     > }
>     >
>     > public class MainClass{
>     >
>     >     private AClass root;
>     >     ....
>     >    //getters and setters
>     > }
>     >
>     > Mapping file looks like this:
>     >
>     > <mapping>
>     >
>     >     <class name=""java_package.IntermediaryClass>
>     >         ...
>     >     </class>
>     >
>     >     <class name="java_package.AClass"
>     > extends="java_package.IntermediaryClass" identity="id">
>     >         <field name="member-1" type="string"/>
>     >         <field name="id" type="integer"/>
>     >         ...
>     >     </class>
>     >
>     >     <class name="java_package.MainClass">
>     >         <field name="root" type="java_package.AClass">
>     >             <bind-xml name="root" reference="true"/>
>     >         </field>
>     >         ...
>     >     </class>
>     >
>     > </mapping>
>     >
>     > When I try to marshal this model, I get this error:
>     > Unable to resolve ID for instance of class
>     >
>     
> 'hr.combis.rule.editor.DT.utils.ArithmeticTreeImpl$ArithmeticTreeConnectorNode'
>     > 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.marshal(Marshaller.java:1657)
>     >     at org.exolab.castor.xml.Marshaller.marshal(Marshaller.java:1861)
>     >     at org.exolab.castor.xml.Marshaller.marshal(Marshaller.java:1861)
>     >     at org.exolab.castor.xml.Marshaller.marshal(Marshaller.java:1861)
>     >     at org.exolab.castor.xml.Marshaller.marshal(Marshaller.java :1855)
>     >     at org.exolab.castor.xml.Marshaller.marshal(Marshaller.java:840)
>     >     at
>     >
>     
> hr.combis.rule.editor.mapping.impl.XMLMappingImpl.marshalRuleModel(XMLMappingImpl.java:105)
>     >     ... 66 more
>     >
>     > Here is ArithmeticTreeImpl$ArithmeticTreeConnectorNode equal to
>     AClass.
>     >
>     > I tried to debug and found out that the Castor's method
>     > XMLClassDescriptorImpl.setIdentity(fieldDesc) is never invoked with
>     > fieldDesc=id when XMLClassDescriptorImpl is class descriptor for
>     > ArithmeticTreeImpl$ArithmeticTreeConnectorNode. Identities are set
>     only
>     > for direct subclasses of BaseClass. (BaseClass has few direct
>     concrete
>     > subclasses, they are not specified above.)
>     > Is this a bug or i'm missing something?
>     > Thanks,
>     >
>     > Marija
> 
> 
>     ---------------------------------------------------------------------
>     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

Reply via email to