Hi,
I'm migrating from OpenJPA version id: openjpa-1.0.0-SNAPSHOT-r420667:559353
to the latest version id: openjpa-1.0.0-SNAPSHOT-r420667:564688
And I'm not able run the application with the same set of procedures I used
earlier(i.e. enhance entities and run).
1). In the base entity, I've method to check if it's a new entity.
@Transient public boolean isNewEntity() ;
It's not throwing any warning messages before, but now I get the following
msg.
18969 samooha-entities WARN [AWT-EventQueue-0] openjpa.MetaData - No
setter was found for method new in type com.sample.entity.BaseEntity while
searching for persistent properties. This method will be ignored. If you
intended for this to be persistent, please add a corresponding setter, or
switch to field access for this type hierarchy.
Should I really switch to field level annotations? And I would also like to
know which approach is better(recommended), field level or property level
annotations?
2). Although I've already enhanced the classes, the following exception is
thrown. (I'm using Spring-2.0.6)
org.springframework.transaction.CannotCreateTransactionException: Could not
open JPA EntityManager for transaction; nested exception is <
openjpa-0.0.0-r420667:564688 fatal general error>
org.apache.openjpa.persistence.PersistenceException:
com.sun.tools.attach.VirtualMachine
Caused by:
<openjpa-0.0.0-r420667:564688 fatal general error>
org.apache.openjpa.persistence.PersistenceException:
com.sun.tools.attach.VirtualMachine
at org.apache.openjpa.enhance.ClassRedefiner.redefineClasses(
ClassRedefiner.java:111)
at
org.apache.openjpa.enhance.ManagedClassSubclasser.prepareUnenhancedClasses(
ManagedClassSubclasser.java:124)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(
AbstractBrokerFactory.java:287)
at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(
AbstractBrokerFactory.java:197)
at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(
DelegatingBrokerFactory.java:142)
at
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(
EntityManagerFactoryImpl.java:190)
at
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(
EntityManagerFactoryImpl.java:143)
at
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(
EntityManagerFactoryImpl.java:55)
at
org.springframework.orm.jpa.JpaTransactionManager.createEntityManagerForTransaction
(JpaTransactionManager.java:391)
at org.springframework.orm.jpa.JpaTransactionManager.doBegin(
JpaTransactionManager.java:315)
at
org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction
(AbstractPlatformTransactionManager.java:350)
....
Caused by: java.lang.ClassNotFoundException:
com.sun.tools.attach.VirtualMachine
at org.java.plugin.standard.StandardPluginClassLoader.loadClass(
StandardPluginClassLoader.java:378)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at org.apache.openjpa.enhance.InstrumentationFactory.getInstrumentation(
InstrumentationFactory.java:76)
at org.apache.openjpa.enhance.ClassRedefiner.redefineClasses(
ClassRedefiner.java:69)
... 36 more
Did I miss any new configuration property to be set?
With Regards,
Prashant.