[ 
https://issues.apache.org/jira/browse/GERONIMO-5553?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12902980#action_12902980
 ] 

Donald Woods commented on GERONIMO-5553:
----------------------------------------

I decompiled your org.apache.sample.entities.Book.class and did not see that it 
had been enhanced.

In OpenJPA 2.0, we have turned RuntimeUnenhancedClasses off/unsupported by 
default (it was enabled in 1.0 and 1.2) -
    
http://openjpa.apache.org/builds/2.0.0/apache-openjpa-2.0.0/docs/manual/manual.html#openjpa.RuntimeUnenhancedClasses

To enable runtime enhancement (which we strongly discourage for production 
applications), you need to update your persistence.xml to set the following 
property -
    <properties>
        <property name="openjpa.RuntimeUnenhancedClasses"  value="supported"/>
        . . .
    </properties>

The better solution, is to use build time enhancement, which can be done via 
ANT, Maven plugin or Eclipse plugin -
    http://openjpa.apache.org/entity-enhancement.html



> Fail to enchance entities on Geronimo
> -------------------------------------
>
>                 Key: GERONIMO-5553
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-5553
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: persistence
>    Affects Versions: 3.0
>         Environment: OS:win xp
> Geronimo :3.0 20100824 build
>            Reporter: Lu Jiang
>             Fix For: 3.0
>
>         Attachments: booknew.war
>
>
> I tried to deploy a simple jpa sample on geronimo.But when persist data into 
> database.
> Following exception will occur.
> <openjpa-2.0.0-r422266:935683 nonfatal user error> 
> org.apache.openjpa.persistence.ArgumentException: Attempt to cast instance 
> "org.apache.sample.entities.b...@97781f" to PersistenceCapable failed.  
> Ensure that it has been enhanced.
> FailedObject: org.apache.sample.entities.b...@97781f

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to