4

I have persistence-api-1.0.2,hibernate-jpa-2.0-api-1.0.1.Final and other related jars in the lib directory. However, when I am deploying war file, I am getting the following error

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

How can I resolve this issue?

Update

Jars in lib folder

enter image description here

Jacob
  • 14,463
  • 65
  • 207
  • 320

1 Answers1

3

Why would you have JPA API 1.0 (which is what persistence-api-1.0.2 is) and JPA API 2.0 (hibernate-jpa-2.0-api) in the CLASSPATH at the same time?? Decide which version of JPA you are using before you do anything else

Neil Stockton
  • 11,383
  • 3
  • 34
  • 29
  • I have removed persistence-api-1.0.2, still I am getting the same error. I have added list of related jars in my question. Thanks – Jacob Dec 06 '14 at 16:08
  • 2
    deploying your app where? app server? most app servers include a version of JPA by default, so adding another one will likely still find the default also – Neil Stockton Dec 06 '14 at 16:13
  • I am trying to deploy to Oracle Application Server 10.1.3.5 OC4J – Jacob Dec 06 '14 at 16:14
  • so look at what jars that appserver includes itself, and search its docs for how to swap out its ancient version of JPA (1.0) – Neil Stockton Dec 06 '14 at 16:18