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

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>