Question

I'm trying to create GAE project via Maven and I'm facing problem with persistence libraries configuration. I try including different dependencies and specifying different scopes, but I always get some errors like:

java.lang.NoClassDefFoundError: org/datanucleus/ObjectManagerFactoryImpl

.

java.lang.NoClassDefFoundError: javax/persistence/spi/ProviderUtil

.

java.lang.NoClassDefFoundError: org/datanucleus/ClassLoaderResolver

.

Invocation of init method failed; nested exception is javax.persistence.PersistenceException: No persistence providers available for "transactions-optional" after trying the following discovered implementations: org.datanucleus.api.jpa.PersistenceProviderImpl
Was it helpful?

Solution

Well, eventually I've found the solution for my case:

    <!-- Persistence Dependencies -->
    <dependency>
        <groupId>com.google.appengine.orm</groupId>
        <artifactId>datanucleus-appengine</artifactId>
        <version>2.1.2</version>
    </dependency>
    <dependency>
        <groupId>javax.jdo</groupId>
        <artifactId>jdo-api</artifactId>
        <version>3.0.1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.geronimo.specs</groupId>
        <artifactId>geronimo-jpa_2.0_spec</artifactId>
        <version>1.1</version>
    </dependency>
    <dependency>
        <groupId>org.datanucleus</groupId>
        <artifactId>datanucleus-core</artifactId>
        <version>[3.1.1, 3.1.99]</version>
    </dependency>
    <dependency>
        <groupId>org.datanucleus</groupId>
        <artifactId>datanucleus-api-jpa</artifactId>
        <version>[3.1.1, 3.1.99]</version>
    </dependency>
    <dependency>
        <groupId>org.datanucleus</groupId>
        <artifactId>datanucleus-jpa-query</artifactId>
        <version>3.0.2</version>
    </dependency>

I hope it will help somebody with same issues.

OTHER TIPS

check the GAE dependencies here https://code.google.com/p/datanucleus-appengine/wiki/Compatibility Its possible you may be using some incompatible versions.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top