我试图在websphere 8.5.5.13上部署war文件。它连接到oracle(11g) db,甚至我也在websphere上创建了数据源连接。

应用程序正在安装,但当我尝试启动应用程序时,会出现以下错误:
由: com.ibm.ws.webcontainer.exception.WebAppNotLoadedException:未能加载webapp引起的29/10/18 15:00:49:733 IST 000001e1 SystemErr R:创建名为“entityManagerFactory”的类路径资源org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class:调用init方法失败的错误;嵌套异常为java.lang.NoSuchMethodError: javax/persistence/Table.indexes()[Ljavax/persistence/Index;(从文件:/C:/Program加载(x86)/IBM/WebSphere/AppServer/plugins/javax.j2ee.persistence.jar由org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@180c62e2)从org.hibernate.cfg.annotations.EntityBinder类调用(从file:/C:/Program%20Files%20(x86)/IBM/WebSphere/AppServer/profiles/DefaultAppServer/installedApps/AntivirusServerNode01Cell/cream_war.ear/cream.war/WEB-INF/lib/hibernate-core-5.0.12.Final.jar到加载)
org.springframework.beans.factory.BeanCreationException:错误导致的29/10/18 15:00:49:733 IST 000001e1 SystemErr R创建名为“entityManagerFactory”的类路径资源init方法调用失败;嵌套异常为java.lang.NoSuchMethodError: javax/persistence/Table.indexes()[Ljavax/persistence/Index;(从文件:/C:/Program加载(x86)/IBM/WebSphere/AppServer/plugins/javax.j2ee.persistence.jar由org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@180c62e2)从org.hibernate.cfg.annotations.EntityBinder类调用(从file:/C:/Program%20Files%20(x86)/IBM/WebSphere/AppServer/profiles/DefaultAppServer/installedApps/AntivirusServerNode01Cell/cream_war.ear/cream.war/WEB-INF/lib/hibernate-core-5.0.12.Final.jar到加载)
我也尝试过更改hibernate和jpa的版本,但这也不起作用。但是,当我不使用oracle (使用h2或derby)部署应用程序时,它会正常运行。
请帮我解决这个错误。
找不到路

发布于 2018-10-29 11:53:35
NoSuchMethodError表示Hibernate试图调用javax.persistence.Table上不存在的方法。Table类是从file:/C:/Program Files (x86)/IBM/WebSphere/AppServer/plugins/javax.j2ee.persistence.jar加载的,所以是它本身提供了不兼容的类。
默认情况下,WAS8.5.5使用JPA2.0,但它通过遵循描述可以使用JPA2.1的步骤来实现这里。您已经完成了“在应用程序中嵌入第三方持久性提供程序”中描述的大部分步骤。剩下的一个步骤是配置应用程序的类加载程序订单,这样它将更喜欢与应用程序捆绑在一起的类,而不是由应用服务器提供的类。
https://stackoverflow.com/questions/53034667
复制相似问题