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

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

问题描述

我想建立我的第一个谷歌应用程序引擎的战争和正在建立自己的外部(Eclipse之外)Ant构建要从终端执行。我试图让< enhance_war /> 蚂蚁宏观的工作和正在运行到一个奇怪的的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>

下面是当它试图执行目标蚂蚁输出:

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

这是蚂蚁macros.xml:95 对应于以下行:

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

所以,事情错了,而执行此&LT;加强/方式&gt; 的任务,但我想不出什么

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

终于在日志文件 /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 ,这我绝对对构建类路径。加上其在的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的核什么的增强要求。验证什么增强剂使用,并修复它。请参见 HTTP://$c$c.google.com/p/ DataNucleus的-的AppEngine /维基/兼容性获得配伍的要求。

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插件2.1.1 IIRC,这是最新的版本(虽然有近期尚未发布FWIW),它是lib下的/ opt / blahblahblah present。这使得使用DataNucleus的v3.1.x.的这是推荐什么人反对运行。 //$c$c.google.com:GAE中JDO插件在 HTTP开发/ 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/

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

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