Runtime exception - Datanucleus enhancer

2019-08-04 15:53发布

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?

1条回答
不美不萌又怎样
2楼-- · 2019-08-04 16:39

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

查看更多
登录 后发表回答