1

我的项目基于 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-jpa-3.1.0-release.jar
  • datanucleus-core-3.1.0-release.jar
  • datanucleus-rdbms-3.1.0-release.jar
  • requestfactory-apt.jar
  • requestfactory-client+src.jar
  • requestfactory-server+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>           

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

4

1 回答 1

2

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

于 2013-01-11T13:41:49.433 回答