Reputation: 61
I am trying to install Hibernate 3.5 jar files in my application. The documentation says hibernate3.jar and hibernate-jpa-2.0-api-1.0.0.Final.jar are suffice. But when I start my application, I get the error java.lang.NoSuchMethodError: javax/persistence/spi/PersistenceUnitInfo.getSharedCacheMode()Ljavax/persistence/SharedCacheMode. This is only fixed by putting hibernate-entitymanager.jar in class path. Is this jar file required? Any inputs are appreciated. Thanks in advance.
Upvotes: 2
Views: 987
Reputation: 18639
Hibernate will require hibernate-entitymanager.jar only if you have JPA schema validation in such cases you have xsi:scemalocation ends with persistence_2_0.xsd.
For Example:
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
Upvotes: 1