Search code examples
gwtjpa-2.0datanucleusrequestfactory

Datanucleus - An error occurred trying to instantiate an instance JPAAdapter


my project is based on GWT(2.4) and my aim is to implement ReqyestFactory (JPA, Datanucleus, Postgresql). During the compilation I don't have any errors. But when I make request to the server I got this error :

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}

In my classpath I have :

  • 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
  • ......

and here is my 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>           

Could you help me with this issue ?


Solution

  • I dont see jdo-api.jar in your dependencies.