Hi Armin, Thanks for your reply.Reply inline. -Rajesh
does OJB log a more detailed error message?
no
Is class UserAccount an interface?
no. UserAccount is an abstract class public abstract class UserAccount extends <some other class>
In the reference-descriptor of EndUser the specified class is IPCEUserAccount. Is it guaranteed that IPCEUserAccount instances are always sub-classes of UserAccount?
yes. public class IPCEUserAccount extends UserAccount
regards, Armin On 4/27/06, Rajesh T V <[EMAIL PROTECTED]> wrote:
Hi, We are hitting an intermittent issue with db-ojb-1.0.3. At random times we hit the following exception while ojb tries to create an object from a Derby db. org.apache.ojb.broker.PersistenceBrokerException: org.apache.ojb.broker.metadata.MetadataException: IllegalAccess error setting field:userAccount in object:com.cisco.ipce.engine.datamodel.EndUser at org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery
(Unknown
Source) at org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery
(Unknown
Source) at org.apache.ojb.broker.core.PersistenceBrokerImpl.getCollectionByQuery
(Unknown
Source) at
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery (Unknown
Source) at
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery (Unknown
Source) at com.cisco.ipce.engine.sal.dataaccess.DBDAO.get(DBDAO.java:367) The root cause being a Caused by: java.lang.IllegalArgumentException at sun.reflect.UnsafeObjectFieldAccessorImpl.set(
UnsafeObjectFieldAccessorImpl.java:63)
at java.lang.reflect.Field.set(Field.java:656) ... 59 more The error occurs on different classes at different times. Once we hit the error, it does not go away no matter what we do (tomcat restart etc). Once the problem stops happening (sometimes on pc restart) it never happens again for a long time. Our repository_user.xml for all classes are similar. <class-descriptor class="com.cisco.ipce.engine.datamodel.EndUser" table="UserBase"> <field-descriptor column="OID" jdbc-type="INTEGER" name="OID" autoincrement="true" primarykey="true"/> <field-descriptor column="userAccountId" jdbc-type="INTEGER" name="userAccountId"/> <reference-descriptor name="userAccount" class-ref="com.cisco.ipce.engine.datamodel.IPCEUserAccount" auto-retrieve="true" auto-update="object" auto-delete="object" > <foreignkey field-ref="userAccountId"/> </reference-descriptor> <field-descriptor column="type" jdbc-type="INTEGER" name="type"/> public class EndUser extends UserBase { ... ... } public abstract class UserBase extends IPCEObject{ ... .... protected UserAccount userAccount; ... } I am not sure what we are doing wrong and even if we are why is the error intermittent ? All classes where the error occurs have the same pattern where a protected attribute of the super-class is being set via the sub-class repository_user.xml entry. The attribute is always an auto-retrieve=true; auto-update="object" and auto-delete="object" class to which the offending class holds a foreign key. Any help appreciated. Thanks, Rajesh