nosuchmethoderror:javax/persistence/persistenceContext.synchronization()

发布于 2025-02-07 22:04:23 字数 734 浏览 1 评论 0原文

将春季版从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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文