gpt4 book ai didi

google-app-engine - AppEngine + DataNucleus + JPA 2 的工作 Maven3 配置

转载 作者:行者123 更新时间:2023-12-04 04:37:23 25 4
gpt4 key购买 nike

我正在尝试通过 Maven 创建 GAE 项目,但我遇到了持久性库配置的问题。我尝试包含不同的依赖项并指定不同的范围,但我总是遇到一些错误,例如:

java.lang.NoClassDefFoundError: org/datanucleus/ObjectManagerFactoryImpl

.
java.lang.NoClassDefFoundError: javax/persistence/spi/ProviderUtil

.
java.lang.NoClassDefFoundError: org/datanucleus/ClassLoaderResolver

.
Invocation of init method failed; nested exception is javax.persistence.PersistenceException: No persistence providers available for "transactions-optional" after trying the following discovered implementations: org.datanucleus.api.jpa.PersistenceProviderImpl

最佳答案

好吧,最终我找到了适合我的案例的解决方案:

    <!-- Persistence Dependencies -->
<dependency>
<groupId>com.google.appengine.orm</groupId>
<artifactId>datanucleus-appengine</artifactId>
<version>2.1.2</version>
</dependency>
<dependency>
<groupId>javax.jdo</groupId>
<artifactId>jdo-api</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jpa_2.0_spec</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>org.datanucleus</groupId>
<artifactId>datanucleus-core</artifactId>
<version>[3.1.1, 3.1.99]</version>
</dependency>
<dependency>
<groupId>org.datanucleus</groupId>
<artifactId>datanucleus-api-jpa</artifactId>
<version>[3.1.1, 3.1.99]</version>
</dependency>
<dependency>
<groupId>org.datanucleus</groupId>
<artifactId>datanucleus-jpa-query</artifactId>
<version>3.0.2</version>
</dependency>

我希望它能帮助有同样问题的人。

关于google-app-engine - AppEngine + DataNucleus + JPA 2 的工作 Maven3 配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19509842/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com