编程语言
首页 > 编程语言> > spring – javax.persistence.spi.PersistenceUnitInfo.getSharedCacheMode()Ljavax / persistence / Shar

spring – javax.persistence.spi.PersistenceUnitInfo.getSharedCacheMode()Ljavax / persistence / Shar

作者:互联网

我在lib目录中有persistence-api-1.0.2,hibernate-jpa-2.0-api-1.0.1.Final和其他相关的jar.但是,当我部署war文件时,我收到以下错误

nested exception is java.lang.NoSuchMethodError:
javax.persistence.spi.PersistenceUnitInfo.getSharedCacheMode()
Ljavax/persistence/SharedCacheMode; 

我该如何解决这个问题?

更新

lib文件夹中的jar

解决方法:

为什么你会在CLASSPATH中同时拥有JPA API 1.0(这是persistence-api-1.0.2)和JPA API 2.0(hibernate-jpa-2.0-api)?
在执行任何其他操作之前,请确定您使用的JPA版本

标签:spring,jpa,hibernate,jpa-2-0,oc4j
来源: https://codeday.me/bug/20190628/1319349.html