nosuchmethoderror:javax/persistence/persistenceContext.synchronization()
将春季版从3.0.5.5.Release升级到5.3.17。 更改版本并构建部署后,正在发生以下错误。
“ org.springframework.beans.factory.beancreationexception:在ServletContext Resources中定义的名称'xxdao'的错误[/web-inf/xxxxx.xml]:合并后的bean定义失败;嵌套异常是java.lang。 nosuchmethoderror:javax/persistence/persistencecontext.synchronization()ljavax/persistence/synchronization type; DefaultClassLoader@4fdd22cb) called from class org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor$PersistenceElement"
From the above error, could see synchronization method is fetching from WebSphere location(extracted the javax.j2ee.persistence.jar and there is no such方法)。 但是以前也在升级春季版之前就在那里,而且工作正常。 作为解决方法,尝试添加Javax.persistence-api-2.2.jar。但仍在尝试从WebSphere位置加载。
请帮忙
Upgrading spring version from 3.0.5.RELEASE to 5.3.17.
After changing the version and build deployment, Following error is happening.
"org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xxDao' defined in ServletContext resource [/WEB-INF/xxxx.xml]: Post-processing of merged bean definition failed; nested exception is java.lang.NoSuchMethodError: javax/persistence/PersistenceContext.synchronization()Ljavax/persistence/SynchronizationType; (loaded from file: .../WebSphere/AppServer/plugins/javax.j2ee.persistence.jar by org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@4fdd22cb) called from class org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor$PersistenceElement"
From the above error, could see synchronization method is fetching from WebSphere location(extracted the javax.j2ee.persistence.jar and there is no such method).
But previously also that jar was there before upgrading the spring version and was working fine.
As workaround, tried to add javax.persistence-api-2.2.jar. But still trying to load from Websphere location.
Please help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论