Google App Engine JDO 增强失败 [英] Google App Engine JDO enhancement is failing

查看:44
本文介绍了Google App Engine JDO 增强失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试构建我的第一个 Google App Engine WAR 并且正在设置我自己的外部(Eclipse 之外)Ant 构建以从终端执行.我正在尝试让 <enhance_war/> Ant 宏正常工作,但遇到了一个奇怪的 NoSuchMethodError.

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. I'm trying to get the <enhance_war/> Ant macro working and am running into a bizarre NoSuchMethodError.

这是我的 Ant 目标:

Here's my Ant target:

<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>

这是 Ant 尝试执行 package 目标时的输出:

Here's the Ant output when it attempts to execute the package target:

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

那个 ant-macros.xml:95 对应下面这行:

That ant-macros.xml:95 corresponds to the following line:

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

所以在执行这个 <enhance/> 任务时出了点问题,但我不知道是什么.

So something is going wrong while executing this <enhance /> task, but I can't figure out what.

最后是 /tmp/enhance4426322586552955387.log 中的日志文件:

And finally the log file at /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

这是怎么回事?我不认为这是一个类路径问题,因为 org.datanucleus.plugin.PluginManager 类是在 datanucleus-core-1.1.5.jar<中定义的/code>,我在构建类路径中绝对拥有.加上它的 NoSuchMethodError,所以它让我觉得我有一个 JAR 地狱/版本控制问题.有什么想法吗?

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. Plus its a NoSuchMethodError, so it makes me feel like I have a JAR hell/versioning issue going on. Any ideas?

推荐答案

您的类路径中的 datanucleus-core 版本与增强器所需的版本不同.验证增强器正在使用什么并修复它.请参阅 http://code.google.com/p/datanucleus-appengine/wiki/兼容性满足兼容性要求.

You have a different version of datanucleus-core in your classpath to what the enhancer requires. Verify what the enhancer is using and fix it. See http://code.google.com/p/datanucleus-appengine/wiki/Compatibility for conpatibility requirements.

最新的 GAE SDK 提供了GAE JDO 插件"v2.1.1 IIRC,这是最新的版本(尽管最近的版本还没有发布),它存在于 lib/opt/blahblahblah 下.这使用了 DataNucleus v3.1.x.这就是建议人们反对的.GAE JDO 插件在 http://code.google.com/p/datanucleus-appengine 开发/

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. This makes use of 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/

这篇关于Google App Engine JDO 增强失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆