openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joshua Jackson" <joshua.j...@gmail.com>
Subject Enhancing a persistent class
Date Wed, 04 Jul 2007 10:53:00 GMT
Dear all,

I received this exception when executing a entitymanager.persist.

org.apache.openjpa.persistence.ArgumentException: Attempt to cast
instance "com.taxandtech.lab.faces.bean.Department@afa4b0" to
PersistenceCapable failed.  Ensure that it has been enhanced.

Why does this occur? How do I solve it? This same code works with
other persistency provider? What makes it different in OpenJPA?

This is my persistence.xml snippets:
    <persistence-unit name="openjpaPU">
    	<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
    	<class>com.taxandtech.lab.faces.bean.Department</class>
    	<properties>
      		<property name="openjpa.ConnectionURL"
value="jdbc:mysql://localhost:3306/test"/>
      		<property name="openjpa.ConnectionDriverName"
value="com.mysql.jdbc.Driver"/>
      		<property name="openjpa.ConnectionUserName" value="joshua"/>
      		<property name="openjpa.ConnectionPassword" value="password"/>
      		<property name="openjpa.Log" value="DefaultLevel=INFO, Tool=INFO"/>
      		<property name="openjpa.jdbc.SynchronizeMappings"
value="buildSchema(ForeignKeys=true)"/>
    	</properties>
    </persistence-unit>

Thanks in advance

-- 
Let's create a highly maintainable and efficient code

YM!: thejavafreak
Blog: http://www.nagasakti.or.id/roller/joshua/

Mime
View raw message