Datanucleus - 尝试实例化JPAAdapter实例时发生错误

时间:2013-01-11 10:27:14

标签: gwt jpa-2.0 datanucleus requestfactory

我的项目基于GWT(2.4),我的目标是实现ReqyestFactory(JPA,Datanucleus,Postgresql)。 在编译期间,我没有任何错误。但是当我向服务器发出请求时,我收到了这个错误:

Caused by: org.datanucleus.exceptions.NucleusUserException: Error : An error occurred     trying to instantiate an instance of the API adapter "org.datanucleus.api.jpa.JPAAdapter" (perha ps you dont have the requisite datanucleus-api-XXX jar in the CLASSPATH, or the api jar for the persistence spec you are using?) : {1}

在我的类路径中,我有:

  • DataNucleus将-API的JP-A-3.1.0-release.jar
  • DataNucleus将核 - 3.1.0-release.jar
  • datanucleus-rdbms-3.1.0-release.jar
  • requestfactory-apt.jar
  • requestfactory-client + src.jar
  • requestfactory服务器+ src.jar
  • 的geronimo-jpa_2.0_spec-1.1.jar
  • 的PostgreSQL-9.2-1002.jdbc4.jar
  • ......

这是我的persistence.xml

<?xml version="1.0" encoding="UTF-8" ?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence 
    http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd" version="2.0">

<persistence-unit name="DBStorage">
    <provider>org.datanucleus.api.jpa.PersistenceProviderImpl</provider>
    <class>com.test.domain.Myobj</class>
    <exclude-unlisted-classes/>
    <properties>
        <property name="datanucleus.ConnectionDriverName"  value="org.postgresql.Driver" />
        <property name="datanucleus.ConnectionURL" value="jdbc:postgresql://localhost:5432/test" />
        <property name="datanucleus.ConnectionUserName" value="test" />
        <property name="datanucleus.ConnectionPassword" value="123" />
    </properties>
</persistence-unit>

</persistence>           

你能帮我解决这个问题吗?

1 个答案:

答案 0 :(得分:2)

我在你的依赖项中没有看到jdo-api.jar。