When I changed the sdk orm jar to v2 (default including by sdk),I got some excepion info.It's about the datanucleus-core-3.0.6.jar has ben registed bla bla.... After search,I knew it was a bug in 3.0.6. So, I relpace it by datanucleus-core-3.0.10.jar. But it not success when compile the pojo Enhancer
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:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.appengine.tools.enhancer.Enhancer.execute(Enhancer.java:74)
... 2 more
Caused by: java.lang.NoSuchMethodError: org.datanucleus.plugin.PluginManager.<init>(Lorg/datanucleus/PersistenceConfiguration;Lorg/datanucleus/ClassLoaderResolver;)V
at org.datanucleus.OMFContext.<init>(OMFContext.java:159)
at org.datanucleus.enhancer.DataNucleusEnhancer.<init>(DataNucleusEnhancer.java:172)
at org.datanucleus.enhancer.DataNucleusEnhancer.<init>(DataNucleusEnhancer.java:150)
at org.datanucleus.enhancer.DataNucleusEnhancer.main(DataNucleusEnhancer.java:1157)
... 7 more
this is my jar file in the \lib\user\orm
asm-3.3.1.jar
datanucleus-api-jdo-3.0.5.jar
datanucleus-api-jpa-3.0.6.jar
datanucleus-appengine-2.0.0-final.jar
datanucleus-core-3.0.10.jar
geronimo-jpa_2.0_spec-1.0.jar
jdo-api-3.0.jar
transaction-api-1.1.jar
I has been looking for all day. Does any know what problem with it?
You have old versions of datanucleus-core and datanucleus-enhancer in the CLASSPATH somewhere. "OMFContext" from that stack trace hasn't existed in DataNucleus for a very long time.
I think I know, why it does not work to upgrade the appengine with a new datanucleus. It is not a classpath entry! I discovered that in the ant-macro.xml
, which triggers the enhancing-step, there is a link to the appengine-tools-api.jar and there is the class EnhancerTask
. This is probably a link to the old version since the new datanucleus-enhancer-3.0.1.jar has it's own EnhancerTask
class. So the only way to use the new versions of datanucleus with the old appengine sdk (in contrary to http://code.google.com/p/datanucleus-appengine/wiki/HowToUpdateTheSDKWithANewPluginVersion) is to do the enhancement-step by either ant
(https://developers.google.com/web-toolkit/doc/1.6/tutorial/appengine) or probably the eclipse-datanucleus-plugin
. Unfortunately this plugin does not work properly in my Eclipse. After install/configure the plugin there is still no project-context menu "datanucleus", where I am supposed to add the support. So I'll try the ant
version.