我的项目基于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}
在我的类路径中,我有:
这是我的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>
你能帮我解决这个问题吗?
答案 0 :(得分:2)
我在你的依赖项中没有看到jdo-api.jar。