【问题标题】:appengine 1.7.4 sdk and com.google.appengine.datanucleus.DatastoreManager not found找不到 appengine 1.7.4 sdk 和 com.google.appengine.datanucleus.DatastoreManager
【发布时间】:2013-01-23 18:53:49
【问题描述】:

我已升级到 appengine 1.7.4,但现在有些问题。

当部署到本地开发时,appengine 出现以下错误。

Class "com.google.appengine.datanucleus.DatastoreManager" was not found in the C
LASSPATH. Please check your specification and your CLASSPATH.
org.datanucleus.exceptions.ClassNotResolvedException: Class "com.google.appengin
e.datanucleus.DatastoreManager" was not found in the CLASSPATH. Please check you
r specification and your CLASSPATH.

这不是 java.lang.ClassNotFoundException 而是 org.datanucleus.exceptions.ClassNotResolvedException

我的库是

appengine-api-1.0-sdk-1.7.4  
appengine-api-labs-1.7.4  
datanucleus-api-jdo-3.2.0-m3  
datanucleus-api-jpa-3.2.0-m3  
datanucleus-appengine-2.1.1  
datanucleus-core-3.2.0-m3  
datanucleus-enhancer-3.1.1  

它是使用 maven 构建的。

DataNucleus App Engine 插件兼容性 http://code.google.com/p/datanucleus-appengine/wiki/Compatibility 状态

3.0:
Requires DataNucleus 3.2+ (core, api-jdo, api-jpa).
Requires SDK 1.7.0+

datanucleus-appengine-2.1.1 pom 依赖于

org.datanucleus datanucleus-api-jdo [3.1.1, 3.2)  
org.datanucleus datanucleus-api-jpa [3.1.1, 3.2)  
org.datanucleus datanucleus-core    [3.1.1, 3.2)  
org.datanucleus datanucleus-enhancer    [3.1.0-release, )  

库的版本有问题,但我无法确定。
DN 插件和 sdk 1.7.4 的正确依赖关系是什么?

-lp

【问题讨论】:

    标签: java google-app-engine datanucleus


    【解决方案1】:

    为什么在 CLASSPATH 中有“datanucleus-api-jdo”和“datanucleus-api-jpa”?确定您正在使用的 API 并使用该 API。其他依赖项在哪里? persistence-api.jar 的 jdo-api.jar ?

    除非您使用 datanucleus-appengine 插件的 SVN 主干,否则您不能使用 DataNUcleus 3.2,如 http://code.google.com/p/datanucleus-appengine/wiki/Compatibility 上清楚显示的那样

    【讨论】:

    • 兼容性文档指出插件 2.1 具有 DataNucleus 3.1+(核心、api-jdo、api-jpa、增强器),但插件 2.1.1 的 maven pom 具有 DN [3.1.1、3.2)。那为什么插件 2.1.1 使用 DN 3.2?
    • 因为Maven是一个合理想法的废话实现,它将“小于3.2”归类为包括3.2.0.mX 3.2之前。 GAE JDO/JPA 插件 v2.1.2 将 DN jar 的版本修复为 3.1.3 或 3.1.4。但是 GAE JDO/JPA 的发布不在我的控制范围内,只是它使用的 jars
    【解决方案2】:

    好的,问题是插件 2.1.1 依赖于 DN 3.2x。 正如@datanucleus 所说,这是不正确的,它应该限制在 DN 3.1.1。

    通过手动将插件的依赖项设置为 DN 3.1.1。现在一切正常。

    感谢@Datanucleus

    【讨论】:

    • 很好,你给它排序,但这样做的正常方法是接受给出解决方案的答案。
    • @Datanucleus 建议的解决方案是使用插件 2.1.2。我的解决方案是使用插件 2.1.1。无论哪种方式,我都很乐意支持您的回答。
    猜你喜欢
    • 2012-12-03
    • 1970-01-01
    • 1970-01-01
    • 2015-08-17
    • 2014-01-27
    • 1970-01-01
    • 2021-01-15
    • 2015-03-02
    • 2021-10-14
    相关资源
    最近更新 更多