gpt4 book ai didi

google-app-engine - 找不到类 org.datanucleus.api.jdo.PersistenceManagerFactoryClass

转载 作者:太空宇宙 更新时间:2023-11-03 15:22:02 25 4
gpt4 key购买 nike

我将 Google App Engine (appengine-java-sdk-1.6.6) 用于使用 JDO 的应用程序,并将 maven (maven-gae-plugin) 用于项目结构和构建。构建成功,同时使用 DataNucleus Enhancer 增强了我的域类。

运行应用程序时,我遇到了这个问题:找不到类 org.datanucleus.api.jdo.PersistenceManagerFactoryClass。任何人都可以请建议。谢谢

PS:我在 APP Engine SDK 文件夹中做了一个 grep(在 linux 上)找到 PersistenceManagerFactoryClass,我找不到它。

Could not instantiate bean class [com.peerbuccoss.apps.mtp.dao.impl.CommonDaoImpl]:  Constructor threw exception; nested exception is javax.jdo.JDOFatalUserException: Class     org.datanucleus.api.jdo.PersistenceManagerFactoryClass was not found.
NestedThrowables:
java.lang.ClassNotFoundException: org.datanucleus.api.jdo.PersistenceManagerFactoryClass:
java.lang.ClassNotFoundException: org.datanucleus.api.jdo.PersistenceManagerFactoryClass
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at com.google.appengine.tools.development.IsolatedAppClassLoader.loadClass(IsolatedAppClassLoader.java:176)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at javax.jdo.JDOHelper$18.run(JDOHelper.java:2018)
at javax.jdo.JDOHelper$18.run(JDOHelper.java:2017)
at java.security.AccessController.doPrivileged(Native Method)
at javax.jdo.JDOHelper.forName(JDOHelper.java:2015)
at javax.jdo.JDOHelper.invokeGetPersistenceManagerFactoryOnImplementation(JDOHelper.java:1162)
at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:808)
at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:1093)
at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:919)

最佳答案

在我的例子中,我使用的是 datanucleus-appengine-2.1.2 而不是 datanucleus-appengine-1.0.10。对于版本 2.1.2,您必须使用以下 PersistenceManagerFactoryClass 更新您的 jdconfig.xml:

<property name="javax.jdo.PersistenceManagerFactoryClass"
value="org.datanucleus.api.jdo.JDOPersistenceManagerFactory"/>

我的 jdconfig.xml 是:

<?xml version="1.0" encoding="utf-8"?>
<jdoconfig xmlns="http://java.sun.com/xml/ns/jdo/jdoconfig"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://java.sun.com/xml/ns/jdo/jdoconfig">

<persistence-manager-factory name="transactions-optional">
<property name="javax.jdo.PersistenceManagerFactoryClass"
value="org.datanucleus.api.jdo.JDOPersistenceManagerFactory"/>
<property name="javax.jdo.option.ConnectionURL" value="appengine"/>
<property name="javax.jdo.option.NontransactionalRead" value="true"/>
<property name="javax.jdo.option.NontransactionalWrite" value="true"/>
<property name="javax.jdo.option.RetainValues" value="true"/>
<property name="datanucleus.appengine.autoCreateDatastoreTxns" value="true"/>
<property name="datanucleus.appengine.singletonPMFForName" value="true"/>
</persistence-manager-factory>
</jdoconfig>

关于google-app-engine - 找不到类 org.datanucleus.api.jdo.PersistenceManagerFactoryClass,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11144721/

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