Persistence manager failing to instantiate

1.4k Views Asked by At

I have a web application project using gwt and using google app engine to store my data. When I run my project I get the following error:

 WARNING: Error for /proj/saat
 java.lang.NoSuchFieldError: NUCLEUS_CONTEXT_LOADER
     at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.<clinit>(JDOPersistenceManagerFactory.java:101)

saat is an the class that I am trying to store on my google app engine. proj is the name of my project. I try to instantiate my persistenceManager in saatServiceImpl in the server package as follows:

    private static final PersistenceManagerFactory pmf = JDOHelper
        .getPersistenceManagerFactory("transactions-optional");

and this the the line the error is issued at. I have no idea how to fix this problem. Any hints is appreciated.

2

There are 2 best solutions below

2
On BEST ANSWER

You are using a wrong DataNucleus library for your GAE environment, check this table and set in your project the appropriate one.

0
On

I don't know how or why but something that worked for me was I opened up com.google.appengine.eclipse.core.prefs and changed the property:

gaeDatanucleusVersion=v2 to gaeDatanucleusVersion=v1