ORM – upgrade GlassFish V2 to JPA 2.0?
I'm trying to use hibernate 3.5 on GlassFish v2 5 and spring hibernate JPA vendoradapter, but when the spring context is initialized, I get the following exception:
java.lang.NoSuchMethodError: javax.persistence.spi.PersistenceUnitInfo.getSharedCacheMode()Ljavax/persistence/SharedCacheMode;
at org. hibernate. ejb. util. LogHelper. Logpersistenceunitinfo (loghelper. Java: 39) is available at org hibernate. ejb. Ejb3Configuration. Configure (ejb3configuration. Java: 517) is available at org hibernate. ejb. HibernatePersistence. createContainerEntityManagerFactory(HibernatePersistence.java:73)
The problem is that GlassFish V2 uses jpa1 0, which is in hibernate-jpa-2.0-api-1.0 0.Final. Jar was previously loaded into the server classpath JPA 1.0 does not have the getsharedcachemodel method in persistenceunitinfo, but JPA 2.0 does not
Is there any way to upgrade GlassFish V2 to use JPA 2.0 (or any other solution to this problem)?
Cheers!
Ĵ
Solution
You can try putting JPA 2.0 jars in the / domain / lib / endorsed directory