Runtime exception - Datanucleus enhancer

喜你入骨 提交于 2019-12-24 08:57:05

问题


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:


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



来源:https://stackoverflow.com/questions/11105914/runtime-exception-datanucleus-enhancer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!