Question

I want to use Datanucleus JDO version 3.2.8 with App Engine to avoid RDBMS string to bigint problem (see https://stackoverflow.com/questions/21588107/datanucleus-jdo-map-string-to-mysql-type-bigint-in-app-engine)

I downloaded Datanucleus App Engine plugin from here http://www.datanucleus.org/products/accessplatform/datastores/appengine.html and created a folder 'v3' in [AppEngine SDK]/lib/opt/tools/datanucleus and [AppEngine SDK]/lib/opt/user/datanucleus where i put the plugin, datanucleus-core, datanucleus rdbms, jdo api jars in version 3.2.8 as well as a "jdo-api-3.0.1.jar" there which was also in the v2 folder I also switched from v2 to v3 in project properties and the project WEB-INF/lib/ contains the new jars.

when I try to enhance classes Datanucleus Enhancer 3.2.8. throws an unexpected exception with following log:

java.lang.RuntimeException: Unexpected exception
    at com.google.appengine.tools.enhancer.Enhancer.execute(Enhancer.java:76)
    at com.google.appengine.tools.enhancer.Enhance.<init>(Enhance.java:71)
    at com.google.appengine.tools.enhancer.Enhance.main(Enhance.java:51)
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.google.appengine.tools.enhancer.Enhancer.execute(Enhancer.java:74)
    ... 2 more
Caused by: java.lang.NoSuchFieldError: updateLock
    at org.datanucleus.api.jdo.metadata.JDOMetaDataManager.getMetaDataForClassInternal(JDOMetaDataManager.java:440)
    at org.datanucleus.metadata.MetaDataManager.getMetaDataForClass(MetaDataManager.java:1488)
    at org.datanucleus.metadata.MetaDataManager.loadClasses(MetaDataManager.java:545)
    at org.datanucleus.enhancer.DataNucleusEnhancer.getFileMetadataForInput(DataNucleusEnhancer.java:737)
    at org.datanucleus.enhancer.DataNucleusEnhancer.enhance(DataNucleusEnhancer.java:513)
    at org.datanucleus.enhancer.DataNucleusEnhancer.main(DataNucleusEnhancer.java:1281)
    ... 7 more

What am I missing to make it work? Thank you very much for your help

Was it helpful?

Solution

The problem is due to you having inconsistent/incompatible versions of DataNucleus jars in the CLASSPATH. The message says that the field "updateLock" is not present in the MetaDataManager. Hence you have some old version of datanucleus-core.jar present in the CLASSPATH somewhere, either in your project, or in the config of this "GAE Eclipse Plugin"

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