我使用 ant 来构建我的 GAE WebApp。这是数据核目标:
<target name="datanucleusenhance" depends="compile"
description="Performs enhancement on compiled data classes.">
<enhance_war war="war">
</enhance_war>
</target>
这是我得到的错误:
org.datanucleus.exceptions.NucleusException:插件(捆绑)“org.datanucleus”已注册。确保类路径中没有同一个插件的多个 JAR 版本。URL“文件:/home/xxxx/.eclipse/org.eclipse.platform_4.2.0_1473617060/plugins/com.google.appengine.eclipse.sdkbundle_1.7.2/appengine-java-sdk-1.7.2/lib/opt/ tools/datanucleus/v1/datanucleus-core-1.1.5.jar" 已经注册,并且您正在尝试注册位于 URL "file:/war/WEB-INF/lib/datanucleus-core-3.1. 0-m5.jar。”
我试过这个蚂蚁目标:
<target name="datanucleusenhance" depends="compile" description="Performs enhancement on compiled data classes.">
<enhance_war war="war">
<args>
<arg value="-enhancerVersion" />
<arg value="v3.1.0" />
</args>
</enhance_war>
</target>
我试图删除“datanucleus-core-1.1.5.jar”。那么错误是:
java.lang.RuntimeException: Unexpected exception
at com.google.appengine.tools.enhancer.Enhancer.execute(Enhancer.java:76)
at com.google.appengine.tools.enhancer.Enhance.<init>(Enhance.java:71)
at com.google.appengine.tools.enhancer.Enhance.main(Enhance.java:51)
Caused by: java.lang.reflect.InvocationTargetException
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 com.google.appengine.tools.enhancer.Enhancer.execute(Enhancer.java:74)
... 2 more
Caused by: java.lang.NoClassDefFoundError: org/datanucleus/OMFContext
at org.datanucleus.enhancer.DataNucleusEnhancer.<init>(DataNucleusEnhancer.java:172)
at org.datanucleus.enhancer.DataNucleusEnhancer.<init>(DataNucleusEnhancer.java:150)
at org.datanucleus.enhancer.DataNucleusEnhancer.main(DataNucleusEnhancer.java:1157)
... 7 more
Caused by: java.lang.ClassNotFoundException: org.datanucleus.OMFContext
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at com.google.appengine.tools.enhancer.EnhancerLoader.loadClass(EnhancerLoader.java:107)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 10 more
如何将 JDO3.0 与 GAE1.7.2 一起使用?