I try to use Hibernate 3.5.5 with Spring HibernateJpaVendorAdapter on Glassfish V2, but I get the following exception when the Spring context is initialized:
java.lang.NoSuchMethodError: javax.persistence.spi.PersistenceUnitInfo.getSharedCacheMode()Ljavax/persistence/SharedCacheMode;
in org.hibernate.ejb.util.LogHelper.logPersistenceUnitInfo (LogHelper.java:39) on org.hibernate.ejb.Ejb3Configuration.configure (Ejb3Configuration.java►17) on org.hibernate.ejb.HibernatePerentererentererentererentererenteristererenterermenteristererentererentererentererentererentererentererenterermenterererer : 73)
The problem is that Glassfish V2 uses JPA1.0, which loads along the server class path to hibernate-jpa-2.0-api-1.0.0.Final.jar, which comes with Hibernate. JPA 1.0 does not have the getSharedCacheModel method in PersistenceUnitInfo, but JPA 2.0 does this.
Is there a way to upgrade Glassfish V2 to use JPA 2.0 (or any other solution to this problem)?
Greetings
J
Jay shark
source share