Search code examples
javagoogle-app-enginegoogle-cloud-endpoints

App Engine Datanucleus won't enhance throws: util.endpoints.ListWrapper has application-identity


I have no idea what happened, but my project all of a sudden starting throwing the error:

Class util.endpoints.ListWrapper has application-identity and no objectid-class specified yet has 0 primary key fields. Unable to use SingleFieldIdentity.

This just randomly started happening, I am running 1.8.9 and using endpoints. I have cleaned, restarted, etc. to no avail, this seems like an issue with endpoints to me. The full stacktrace is:

DataNucleus Enhancer (version 3.1.1) : Enhancement of classes
Feb 01, 2014 8:06:13 AM org.datanucleus.metadata.AbstractClassMetaData    determineObjectIdClass
 SEVERE: Class util.endpoints.ListWrapper has application-identity and no objectid-class    specified yet has 0 primary key fields. Unable to use SingleFieldIdentity.
Class util.endpoints.ListWrapper has application-identity and no objectid-class specified yet has 0 primary key fields. Unable to use SingleFieldIdentity.
Feb 01, 2014 8:06:13 AM org.datanucleus.enhancer.DataNucleusEnhancer main
 DataNucleus Enhancer completed with an error. Please review the enhancer log for full details. Some classes may have been enhanced but some caused errors
SEVERE: DataNucleus Enhancer completed with an error. Please review the enhancer log for   full details. Some classes may have been enhanced but some caused errors
Class util.endpoints.ListWrapper has application-identity and no objectid-class specified yet has 0 primary key fields. Unable to use SingleFieldIdentity.

org.datanucleus.metadata.InvalidClassMetaDataException: Class util.endpoints.ListWrapper has application-identity and no objectid-class specified yet has 0 primary key fields. Unable to use SingleFieldIdentity. at org.datanucleus.metadata.AbstractClassMetaData.determineObjectIdClass(AbstractClassMetaData.java:1355) at org.datanucleus.metadata.ClassMetaData.populate(ClassMetaData.java:209) at org.datanucleus.metadata.MetaDataManager$1.run(MetaDataManager.java:2699) at java.security.AccessController.doPrivileged(Native Method) at org.datanucleus.metadata.MetaDataManager.populateAbstractClassMetaData(MetaDataManager.java:2693) at org.datanucleus.metadata.MetaDataManager.populateFileMetaData(MetaDataManager.java:2516) at org.datanucleus.metadata.MetaDataManager.initialiseFileMetaDataForUse(MetaDataManager.java:1123) at org.datanucleus.metadata.MetaDataManager.loadClasses(MetaDataManager.java:543) at org.datanucleus.enhancer.DataNucleusEnhancer.getFileMetadataForInput(DataNucleusEnhancer.java:734) at org.datanucleus.enhancer.DataNucleusEnhancer.enhance(DataNucleusEnhancer.java:525) at org.datanucleus.enhancer.DataNucleusEnhancer.main(DataNucleusEnhancer.java:1258) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at com.google.appengine.tools.enhancer.Enhancer.execute(Enhancer.java:74) at com.google.appengine.tools.enhancer.Enhance.(Enhance.java:71) at com.google.appengine.tools.enhancer.Enhance.main(Enhance.java:51)


Solution

  • In order to work around this I unchecked the src directory in using the ORM options under App Engine. The menu path is Google > App Engine > ORM. I have all my data classes in one place and so I just included this path only instead of the default src folder. The effect is the datanucleus enhancer doesn't run on the end point classes anymore.

    I do think their is a bug with Endpoints that is causing this currently, but hopefully this helps someone find a work around.