Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ClassNotFoundException: org.datanucleus.store.appengine.jpa.DatastorePersistenceProvider

I try to start an Google appengine application in my eclipse.

I have the Google plugin and I set the sdk for my application.

But, when I start this one, I get the following error:

java.lang.ClassNotFoundException: org.datanucleus.store.appengine.jpa.DatastorePersistenceProvider

However, this class is present in the sdk which is present in my classpath.

Why Appengine doesn't find this class ?

Thanks.

like image 780
Kiva Avatar asked Mar 07 '26 00:03

Kiva


1 Answers

https://developers.google.com/appengine/docs/java/datastore/jpa/overview-dn2

Please try to follow the steps to add JPA and datastore JARs in the app's war/WEB-INF/lib/ directory.

All the jars in the appengine-java-sdk/lib/opt/user/datanucleus/v2/ directory.

I met the same problem and followed the steps on that webpage. Now my code works well.

I believe that problems happens because we are using JPA 2.0 instead of JPA 1.0 now.

Also, please make sure you are using org.datanucleus.api.jpa.PersistenceProviderImpl as the provider instead of org.datanucleus.store.appengine.jpa.DatastorePersistenceProvider. At least I used the new provider because I am developing GAE projects using the newest GAE plug-in

Good luck.

like image 55
Qingye Jiang Avatar answered Mar 10 '26 00:03

Qingye Jiang



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!