【问题标题】:Runtime exception - Datanucleus and GAE运行时异常 - Datanucleus 和 GAE
【发布时间】:2012-11-28 22:18:34
【问题描述】:

我是 Google 应用引擎和数据核的新手。以下错误似乎是一些 jar 问题,但我不确定 Data nucleus 的哪些 jar 应该在我的 war/web-inf/classes 文件夹中,哪些 jar 应该在 app engine SDK 文件夹中。我正在使用 App 引擎 SDK 1.7.0。我在数据核增强方面没有问题。

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.OMFContext.<init>(OMFContext.java:141)
    at org.datanucleus.ObjectManagerFactoryImpl.initialiseOMFContext(ObjectManagerFactoryImpl.java:144)
    at org.datanucleus.jdo.JDOPersistenceManagerFactory.initialiseProperties(JDOPersistenceManagerFactory.java:316)
    at org.datanucleus.jdo.JDOPersistenceManagerFactory.<init>(JDOPersistenceManagerFactory.java:260)
    at org.datanucleus.store.appengine.jdo.DatastoreJDOPersistenceManagerFactory.<init>(DatastoreJDOPersistenceManagerFactory.java:71)
<continued in next message>

在应用引擎 SDK 文件夹中还有各种其他文件夹,它们包含不同版本的相同数据核文件。

*编辑:* 将 SDK 更新到 1.7.3 后,我注意到 appengine-java-sdk-1.7.3\lib\user\orm 文件夹中有以下 JARS,这些是那里存在的 datanucleus jar。

datanucleus-core-1.1.5
datanucleus-jpa-1.1.5
datanucleus-appengine-1.0.10.final
jdo2-api-2.3-eb

我的 war/web-inf/lib 包含所有上述 jar 和以下 jar:

appengine-api-1.0-sdk-1.7.3.jar

我的例外已经改变,现在是:

    2012-12-12 12:49:17.397
org.datanucleus.plugin.NonManagedPluginRegistry resolveConstraints: Bundle "org.datanucleus.api.jdo" requires "org.datanucleus" version "3.1.1" but the resolved bundle has version "3.1.1" which is outside the expected range.
E 2012-12-12 12:49:17.534
org.datanucleus.api.ApiAdapterFactory getApiAdapter: Error : An error occurred trying to instantiate an instance of the adapter "org.datanucleus.api.jdo.JDOAdapter" : NUCLEUS_CONTEXT_LOADER
W 2012-12-12 12:49:18.182
org.datanucleus.OMFContext setApi: There is no available API adapter "JDO". Using existing adapter.
E 2012-12-12 12:49:18.182
org.datanucleus.api.ApiAdapterFactory getApiAdapter: Error : An error occurred trying to instantiate an instance of the adapter "org.datanucleus.api.jdo.JDOAdapter" : Could not initialize class org.datanucleus.api.jdo.JDOAdapter

【问题讨论】:

    标签: java eclipse google-app-engine datanucleus


    【解决方案1】:

    Appengine JDO/JPA 插件 Wiki defines well enough 每个版本的插件需要哪些 DataNucleus jar

    【讨论】:

    • 我没有安装数据核插件,只有谷歌应用引擎插件在那里。现在我已经安装了 Data nucleus 插件 2.0.4。兼容性页面指出版本 2 需要 DataNucleus 3.0+(核心、api-jdo、api-jpa、增强器)。我现在有 2 个问题: 1-我的 google app engine (1.7.0) SDK 还包含 user/orm 文件夹中的数据核 Jar 文件。我也需要升级这些罐子吗? 2- eclipse中安装data nucleus插件后怎么办?
    • 没有 GAE JDO/JPA 插件 v2.0.4 之类的东西。 repo1.maven.org/maven2/com/google/appengine/orm/…
    • 只需将您的 AppEngine SDK 升级到最新版本(1.7.3?),您就可以轻松安装所需的一切。为什么你要安装一些不相关的 Eclipse 插件,我不知道
    • opt/user/datanucleus/v2 有所有需要的 jar,按照 AppEngine developers.google.com/appengine/docs/java/datastore/jdo/… 中的说明,他们的文档告诉你如何升级
    猜你喜欢
    • 2012-06-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-03-11
    • 2014-11-12
    • 1970-01-01
    • 2011-02-21
    • 1970-01-01
    相关资源
    最近更新 更多