App Engine Datanucleus不会增强throws:util.endpoints.ListWrapper具有应用程序标识

时间:2014-02-01 16:37:39

标签: java google-app-engine google-cloud-endpoints

我不知道发生了什么,但我的项目突然开始抛出错误:

类util.endpoints.ListWrapper具有应用程序标识,并且没有指定objectid-class但还有0个主键字段。无法使用SingleFieldIdentity。

这只是随机开始发生,我运行1.8.9并使用端点。我已经清理,重新启动等无济于事,这对我来说似乎是一个端点问题。完整的堆栈跟踪是:

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:类util.endpoints.ListWrapper具有应用程序标识,并且未指定objectid-class,但具有0个主键字段。无法使用SingleFieldIdentity。     at org.datanucleus.metadata.AbstractClassMetaData.determineObjectIdClass(AbstractClassMetaData.java:1355)     在org.datanucleus.metadata.ClassMetaData.populate(ClassMetaData.java:209)     在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)     在org.datanucleus.metadata.MetaDataManager.initialiseFileMetaDataForUse(MetaDataManager.java:1123)     在org.datanucleus.metadata.MetaDataManager.loadClasses(MetaDataManager.java:543)     at org.datanucleus.enhancer.DataNucleusEnhancer.getFileMetadataForInput(DataNucleusEnhancer.java:734)     在org.datanucleus.enhancer.DataNucleusEnhancer.enhance(DataNucleusEnhancer.java:525)     在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)     在com.google.appengine.tools.enhancer.Enhancer.execute(Enhancer.java:74)     在com.google.appengine.tools.enhancer.Enhance。(Enhance.java:71)     在com.google.appengine.tools.enhancer.Enhance.main(Enhance.java:51)

2 个答案:

答案 0 :(得分:0)

为了解决这个问题,我在使用App Engine下的ORM选项时取消选中了src目录。菜单路径是Google> App Engine> ORM。我将所有数据类放在一个地方,因此我只包含此路径而不是默认的src文件夹。效果是datanucleus增强器不再在终点类上运行。

我认为他们的端点是一个导致此问题的错误,但希望这有助于某人找到解决方法。

答案 1 :(得分:0)

对于所有在使用@Id注释时遇到异常的人,请检查您是否使用了来自javax.persistance。*的@Id,而不是org.springframework.data.annotation.Id或其他内容。