Exception regarding runtime optimization using openJPA MySQL

旧街凉风 提交于 2019-12-04 09:32:39

I see you have main class, therefore I assume you are using it in Java SE environment. The easiest way to make it work is to define -javaagent in command line, like this:

java -jar myJAR.jar -javaagent:openjpa-all-2.3.0.jar

It is also possible from Eclipse: Run->Run Configurations->find your application in "Java Applications"->Arguments->VM arguments->add

-javaagent:/full/path/to/openjpa-all-2.3.0.jar

By inspecting [ManagedClassSubclasser]1 code you can see that this is more like a warning. If you want to silence this exception and log a warning instead by:

<property name="openjpa.RuntimeUnenhancedClasses" value="warn"/>

I would like to add my experience while faced same kind of problem. If you are usng the tomcat it doesn't implement the full spec for OpenJPA you need to provide the enhancements separately. For the enhancement follow the instructions available on this link http://openjpa.apache.org/enhancement-with-eclipse.html. And you will be good to go. NOTE: i know you are not using any server, but in case you want to use tomcat then you need to follow the link.

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