david
david

Reputation: 61

Is hibernate-entitymanager.jar required for Hibernate 3.5 version

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

Answers (1)

danny.lesnik
danny.lesnik

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

Related Questions