Issue Details (XML | Word | Printable)

Key: NUCENHANCER-74
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: subes
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
DataNucleus Enhancer (ARCHIVED)

RuntimeEnhancer: cannot instantiate abstract class

Created: 24/Apr/11 03:41 PM   Updated: 17/Jun/11 05:14 PM   Resolved: 26/Apr/11 08:14 PM
Component/s: Runtime Enhancer
Affects Version/s: 2.1.3, 3.0.0.m3
Fix Version/s: 3.0.0.m4

File Attachments: 1. Zip Archive runtimeenhancer-testcase.zip (4 kB)


Severity: Development


 Description  « Hide
I experiance the following exception when trying to use the enhancer javaagent:

24.04.2011 15:35:39 org.datanucleus.metadata.MetaDataManager loadPersistenceUnit
INFO: Not found any metadata mapping files for resource name META-INF/orm.xml in CLASSPATH
24.04.2011 15:35:39 org.datanucleus.api.jpa.metadata.JPAAnnotationReader processClassAnnotations
INFO: Class "org.datanucleus.test.TestEntity" has been specified with JPA annotations so using those.
24.04.2011 15:35:39 org.datanucleus.api.jpa.metadata.JPAAnnotationReader processClassAnnotations
INFO: Class "org.datanucleus.test.AEntity" has been specified with JPA annotations so using those.
24.04.2011 15:35:40 org.datanucleus.api.jpa.metadata.JPAAnnotationReader processClassAnnotations
INFO: Class "org.datanucleus.test.TestEntity" has been specified with JPA annotations so using those.
24.04.2011 15:35:40 org.datanucleus.api.jpa.metadata.JPAAnnotationReader processClassAnnotations
INFO: Class "org.datanucleus.test.AnotherTestEntity" has been specified with JPA annotations so using those.
24.04.2011 15:35:40 org.datanucleus.enhancer.RuntimeEnhancer enhance
SCHWERWIEGEND: Class AnotherTestEntity has a persistence-capable-superclass org.datanucleus.test.AEntity which is NOT a superclass of the class.
org.datanucleus.metadata.InvalidMetaDataException: Class AnotherTestEntity has a persistence-capable-superclass org.datanucleus.test.AEntity which is NOT a superclass of the class.
at org.datanucleus.metadata.AbstractClassMetaData.validateSuperClass(AbstractClassMetaData.java:734)
at org.datanucleus.metadata.AbstractClassMetaData.determineSuperClassName(AbstractClassMetaData.java:690)
at org.datanucleus.metadata.ClassMetaData.populate(ClassMetaData.java:192)
at org.datanucleus.metadata.MetaDataManager$1.run(MetaDataManager.java:2495)
at java.security.AccessController.doPrivileged(Native Method)
at org.datanucleus.metadata.MetaDataManager.populateAbstractClassMetaData(MetaDataManager.java:2489)
at org.datanucleus.metadata.MetaDataManager.populateFileMetaData(MetaDataManager.java:2316)
at org.datanucleus.metadata.MetaDataManager.loadAnnotationsForClass(MetaDataManager.java:2457)
at org.datanucleus.api.jpa.metadata.JPAMetaDataManager.getMetaDataForClassInternal(JPAMetaDataManager.java:300)
at org.datanucleus.metadata.MetaDataManager.getMetaDataForClass(MetaDataManager.java:1266)
at org.datanucleus.enhancer.RuntimeEnhancer.enhance(RuntimeEnhancer.java:170)
at org.datanucleus.enhancer.DataNucleusClassFileTransformer.transform(DataNucleusClassFileTransformer.java:115)
at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:385)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at org.datanucleus.JDOClassLoaderResolver.classOrNull(JDOClassLoaderResolver.java:550)
at org.datanucleus.JDOClassLoaderResolver.classForName(JDOClassLoaderResolver.java:201)
at org.datanucleus.JDOClassLoaderResolver.classForName(JDOClassLoaderResolver.java:412)
at org.datanucleus.metadata.MetaDataManager.loadPersistenceUnit(MetaDataManager.java:854)
at org.datanucleus.api.jpa.JPAEntityManagerFactory.initialiseNucleusContext(JPAEntityManagerFactory.java:672)
at org.datanucleus.api.jpa.JPAEntityManagerFactory.<init>(JPAEntityManagerFactory.java:369)
at org.datanucleus.api.jpa.PersistenceProviderImpl.createEntityManagerFactory(PersistenceProviderImpl.java:91)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:152)
at org.datanucleus.test.Main.main(Main.java:12)

24.04.2011 15:35:40 org.datanucleus.api.jpa.metadata.JPAAnnotationReader processClassAnnotations
INFO: Class "org.datanucleus.test.AnotherTestEntity" has been specified with JPA annotations so using those.
24.04.2011 15:35:40 org.datanucleus.api.jpa.metadata.JPAAnnotationReader processClassAnnotations
INFO: Class "org.datanucleus.test.AEntity" has been specified with JPA annotations so using those.
24.04.2011 15:35:40 org.datanucleus.store.rdbms.table.AbstractTable create
INFO: Creating table DELETEME1303652140818
24.04.2011 15:35:40 org.datanucleus.store.rdbms.table.AbstractTable drop
INFO: Dropping table DELETEME1303652140818
24.04.2011 15:35:40 org.datanucleus.store.rdbms.RDBMSStoreManager initialiseSchema
INFO: Initialising Catalog "PUBLIC", Schema "PUBLIC" using "None" auto-start option
24.04.2011 15:35:40 org.datanucleus.store.rdbms.RDBMSStoreManager initialiseSchema
INFO: Catalog "PUBLIC", Schema "PUBLIC" initialised - managing 0 classes
24.04.2011 15:35:40 org.datanucleus.NucleusContext logConfiguration
INFO: ================= Persistence Configuration ===============
24.04.2011 15:35:40 org.datanucleus.NucleusContext logConfiguration
INFO: DataNucleus Persistence Factory - Vendor: "DataNucleus" Version: "3.0.0.m4"
24.04.2011 15:35:40 org.datanucleus.NucleusContext logConfiguration
INFO: DataNucleus Persistence Factory initialised for datastore URL="jdbc:hsqldb:mem:nucleus" driver="org.hsqldb.jdbcDriver" userName="sa"
24.04.2011 15:35:40 org.datanucleus.NucleusContext logConfiguration
INFO: ===========================================================
24.04.2011 15:35:40 org.datanucleus.store.StoreDataManager registerStoreData
INFO: Managing Persistence of Class : org.datanucleus.test.AEntity [Table : (none), InheritanceStrategy : subclass-table]
24.04.2011 15:35:40 org.datanucleus.store.StoreDataManager registerStoreData
INFO: Managing Persistence of Class : org.datanucleus.test.TestEntity [Table : TESTENTITY, InheritanceStrategy : new-table]
24.04.2011 15:35:40 org.datanucleus.store.rdbms.table.AbstractTable create
INFO: Creating table TESTENTITY
24.04.2011 15:35:40 org.datanucleus.store.rdbms.table.AbstractTable create
INFO: Creating table SEQUENCE_TABLE
24.04.2011 15:35:40 org.datanucleus.test.Main main
INFO: >> Exception thrown persisting objects
javax.jdo.JDOFatalInternalException: Cannot instantiate abstract class.
at org.datanucleus.test.AEntity.jdoNewInstance(AEntity.java)
at org.datanucleus.state.AbstractStateManager.saveFields(AbstractStateManager.java:213)
at org.datanucleus.state.JDOStateManagerImpl.initialiseForPersistentNew(JDOStateManagerImpl.java:364)
at org.datanucleus.state.ObjectProviderFactory.newForPersistentNew(ObjectProviderFactory.java:163)
at org.datanucleus.ObjectManagerImpl.persistObjectInternal(ObjectManagerImpl.java:1607)
at org.datanucleus.ObjectManagerImpl.persistObject(ObjectManagerImpl.java:1435)
at org.datanucleus.api.jpa.JPAEntityManager.persist(JPAEntityManager.java:486)
at org.datanucleus.test.Main.main(Main.java:26)


I've attached a testcase that reproduces this issue. The same classes are working fine with compile time enhancement.

subes made changes - 24/Apr/11 03:41 PM
Field Original Value New Value
Attachment runtimeenhancer-testcase.zip [ 11437 ]
subes added a comment - 24/Apr/11 03:45 PM
Forgot to add: also doesn't work with latest 2.x.x

Andy Jefferson made changes - 24/Apr/11 07:55 PM
Affects Version/s 2.1.3 [ 11100 ]
Affects Version/s 3.0.0.m4 [ 11226 ]
Andy Jefferson added a comment - 26/Apr/11 08:14 PM
Works with SVN trunk on that case.

Andy Jefferson made changes - 26/Apr/11 08:14 PM
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 3.0.0.m4 [ 11226 ]
Resolution Fixed [ 1 ]
subes added a comment - 29/Apr/11 06:29 PM
confirmed, thanks!

Andy Jefferson made changes - 17/Jun/11 05:14 PM
Status Resolved [ 5 ] Closed [ 6 ]