In order to trigger the Datanucleus enhancer, I needed to do a dummy modify the Persistable class/Entity then save it again.
However when triggered, throws/logs this error:
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:601)
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
Although the datanucleus-enhancer-3.0.1 is in the Maven classpath and also in the WEB-INF/folder.
What can be causing this error if not missing libraries?
Do you believe everything you read on the internet? What has jasper-compiler got to do with DataNucleus enhancement? Answer : nothing. That post was about some method missing from some Jasper class … which you don’t have.
You simply are using inconsistent versions of “datanucleus-enhancer” and “datanucleus-core”. If you were using Maven you wouldn’t have the issue, but since you aren’t you can see easily enough here that if using datanucleus-enhancer 3.0.1 then you need datanucleus-core 3.0.x also. After all that is what NoSuchMethodError implies also … some thing is not present in the CLASSPATH. The packaged DataNucleus zip distributions always provide ALL consistent files, so you haven’t used one of those either