Hi Gul, On Nov 1, 2007, at 3:42 AM, Gul Onural wrote:
Hi, I enhanced my JPA class using PCEnhancer, but I am still getting org.apache.openjpa.persistence.ArgumentException, when openjpa attempts to cast instance of my JPA class.[11/1/07 5:26:44:423 GMT-05:00] 00000020 SystemErr R <0.0.0 nonfatal user error> org.apache.openjpa.persistence.ArgumentException: Attempt to cast instance "com.test.Employee" to PersistenceCapable failed. Ensurethat it has been enhanced. What would cause this to happen ?
This does sound like a class loader problem. You might be getting an unenhanced class instead of your enhanced class. Are you enhancing in place, and have no other copy of the class somewhere (in your class path)?
What type of debugging can tell me more about why this is happening ?
Can you put a statement into your code like (if ! presumablyEnhancedInstance instanceof PersistenceCapable) {throw RuntimeException("PresumablyEnhancedClass not enhanced");}
Would it be because of incorrect packaging of JPA files ?
That's my guess.
I am using JPA files from an Mbean (management bean) in IBM Websphere. My Mbean is packaged a war file. Where does openjpa look for JPA classes and persistence.xml file in this case ?
I don't know this environment well enough to comment. Craig
Gul
Craig Russell Architect, Sun Java Enterprise System http://java.sun.com/products/jdo 408 276-5638 mailto:[EMAIL PROTECTED] P.S. A good JDO? O, Gasp!
smime.p7s
Description: S/MIME cryptographic signature
