简体   繁体   English

Google App Engine JDO增强功能失败

[英]Google App Engine JDO enhancement is failing

I am trying to build my first Google App Engine WAR and am setting up my own external (outside of Eclipse) Ant build to be executed from the terminal. 我正在尝试构建我的第一个Google App Engine WAR,并且我正在设置我自己的外部(Eclipse之外)Ant构建,以便从终端执行。 I'm trying to get the <enhance_war/> Ant macro working and am running into a bizarre NoSuchMethodError . 我正在尝试让<enhance_war/> Ant宏工作,并且遇到了奇怪的NoSuchMethodError

Here's my Ant target: 这是我的Ant目标:

<target name="package" depends="gendocs">
    <echo message="Enhancing WAR JDO classes." />
    <enhance_war war="war" />

    <echo message="Packaging the WAR file." />
    <war destfile="gen/dist/myapp.war" webxml="war/web.xml">
        <fileset dir="war">
            <includes name="**/*.xml" />
        </fileset>
        <lib dir="war/WEB-INF/lib" />
        <classes dir="war/WEB-INF/classes" />
    </war>
</target>

Here's the Ant output when it attempts to execute the package target: 这是尝试执行package目标时的Ant输出:

package:
     [echo] Enhancing WAR JDO classes.
  [enhance] Encountered a problem: Unexpected exception
  [enhance] Please see the logs [/tmp/enhance4426322586552955387.log] for further information.

BUILD FAILED
/home/myuser/sandbox/workbench/eclipse/workspace/myapp/build/build-local.xml:193: The following error occurred while executing this line:
/home/myuser/sandbox/workbench/google/gae-sdk/1.7.1/appengine-java-sdk-1.7.1/config/user/ant-macros.xml:95: Java returned: 1

That ant-macros.xml:95 corresponds to the following line: ant-macros.xml:95对应于以下行:

<enhance failonerror="true" api="@{api}">
    <!-- Rest of the enhance task def -->
</enhance>

So something is going wrong while executing this <enhance /> task, but I can't figure out what. 所以在执行这个<enhance />任务时出错了,但我无法弄清楚是什么。

And finally the log file at /tmp/enhance4426322586552955387.log : 最后是/tmp/enhance4426322586552955387.log的日志文件:

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.NoSuchMethodError: org.datanucleus.plugin.PluginManager.<init>(Lorg/datanucleus/PersistenceConfiguration;Lorg/datanucleus/ClassLoaderResolver;)V
    at org.datanucleus.OMFContext.<init>(OMFContext.java:159)
    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

What's going on here? 这里发生了什么? I don't think it's a classpath issue because the org.datanucleus.plugin.PluginManager class is defined inside of datanucleus-core-1.1.5.jar , which I absolutely have on the build classpath. 我不认为这是一个类路径问题,因为org.datanucleus.plugin.PluginManager类是在datanucleus-core-1.1.5.jar ,我绝对在构建类路径中。 Plus its a NoSuchMethodError , so it makes me feel like I have a JAR hell/versioning issue going on. 加上它的NoSuchMethodError ,所以它让我觉得我有一个JAR地狱/版本问题正在进行中。 Any ideas? 有任何想法吗?

You have a different version of datanucleus-core in your classpath to what the enhancer requires. 您的类路径中有一个不同版本的datanucleus-core,它与增强器所需的版本相同。 Verify what the enhancer is using and fix it. 验证增强程序正在使用的内容并进行修复。 See http://code.google.com/p/datanucleus-appengine/wiki/Compatibility for conpatibility requirements. 有关兼容性要求,请参阅http://code.google.com/p/datanucleus-appengine/wiki/Compatibility

The latest GAE SDK provides "GAE JDO plugin" v2.1.1 IIRC, which is the most recent release (though there is more recent not yet released fwiw), and it is present under lib/opt/blahblahblah. 最新的GAE SDK提供了“GAE JDO插件”v2.1.1 IIRC,这是最新版本(虽然最近还没有发布fwiw),它存在于lib / opt / blahblahblah下。 This makes use of DataNucleus v3.1.x. 这使用了DataNucleus v3.1.x. This is what people are recommended to run against. 这是人们被推荐反对的。 The GAE JDO plugin is developed at http://code.google.com/p/datanucleus-appengine/ GAE JDO插件是在http://code.google.com/p/datanucleus-appengine/上开发的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM