4

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.

Manolo Carrasco Moñino
  • 9,723
  • 1
  • 22
  • 27
BBB
  • 305
  • 1
  • 6
  • 19

2 Answers2

2

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

Manolo Carrasco Moñino
  • 9,723
  • 1
  • 22
  • 27
  • I have DataNucleus Enhancer (version 1.1.4) and app engine sdk 1.7.4, and I am running java 1.6.0-38. So I think I need DataNucleus 3.1+, but I dont know how to install or change the settings. – BBB Feb 24 '13 at 19:07
  • That depends on your project. If you are using maven take a look to the output of the `mvn dependency:tree` of your project. If you are using eclipse, try to create a new project check whether it works, and compare the configuration with your project. – Manolo Carrasco Moñino Feb 24 '13 at 19:40
1

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

nanospeck
  • 3,388
  • 3
  • 36
  • 45