Datanucleus uses improper enhancer in Google App Engine 1.7

It’s hard for me to get Datanucleus 2 to work properly with class enhancement on GAE 1.7.0 in Eclipse using the Datanucleus plugin. This worked fine in older versions of GAE when I followed these steps:

http://www.datanucleus.org/products/accessplatform/guides/eclipse/index.html

But since the update, GAE now includes these libs (newer versions are similar), and GAE also has a new "Enhancer" flag that you can set. However, I cannot find this flag in Eclipse. GAE seems to still include v1 libs when I want V2 libs and Datanucleus to have conflicts according to this error:

Jul 1, 2012 5:59:55 PM org.datanucleus.enhancer.DataNucleusEnhancer <init>
INFO: DataNucleus Enhancer : Using ClassEnhancer "ASM" for API "JPA"
Exception in thread "main" java.lang.NoSuchFieldError: NUCLEUS_CONTEXT_LOADER
    at org.datanucleus.NucleusContext.<clinit>(NucleusContext.java:73)
    at org.datanucleus.enhancer.DataNucleusEnhancer.<init>(DataNucleusEnhancer.java:171)
    at org.datanucleus.enhancer.DataNucleusEnhancer.main(DataNucleusEnhancer.java:1265)

I have tried many different things. I tried using all the defaults. I tried adding v2 libs to the Datanucleus path class entries. I tried to remove v1 libs in the GAE 1.7.0 SDK in both src and libs. But somehow GAE is still pulling (or trying to pull on V1 libs). I even tried the older manual configuration method, as indicated in the link above. This is a little frustrating because it seems like I'm in a situation where I cannot use these libraries at all. At least with older versions of GAE, I could manually configure it to work. Now nothing works. Any suggestions?

+5
source share
1 answer

I hit the same error and was able to resolve it in my project:

  • , DavidB , DataNucleus JPA .
  • "V1" /WEB -INF/lib

DavidB, , . ".settings", com.google.appengine.eclipse.core.prefs. gaeDatanucleusVersion = v1 gaeDatanucleusVersion = v2

, war/WEB-INF/lib:

  • DataNucleus-AppEngine-1.0.10.final.jar
  • DataNucleus--1.1.5.jar
  • DataNucleus-JPA-1.1.5.jar
  • -jpa_3.0_spec-1.1.1.jar
  • -jta_1.1_spec-1.1.1.jar
  • jdo2--2,3-eb.jar

, .

+7

All Articles