-3

I am trying to integrate Spring 4 with Hibernate 4 and i am using eclipse ide with out maven dependencies,But i am getting below mentioned error:

Caused by: java.lang.classnotfoundexception : org.hibernate.annotations.Entity

if any one has implemented already and working fine, So please can you share the project for reference so that i can understand the flow of integration, As i am new to spring and hibernate.I need some good guidance.

  • The error means that you are missing a JAR file on the classpath. You need to find the JAR file that contains the class `org.hibernate.annotations.Entity` and add it to your project in Eclipse. This file should be in `hibernate-core-4.x.x.Final.jar` – Jesper Aug 03 '17 at 05:55
  • But note also that `org.hibernate.annotations.Entity` is deprecated, you should use the JPA annotation `javax.persistence.Entity` instead. – Jesper Aug 03 '17 at 05:57
  • 2
    https://stackoverflow.com/questions/7985970/org-hibernate-annotations-entity-deprecated-in-hibernate-4 – soorapadman Aug 03 '17 at 06:00

1 Answers1

-2

you need to use some dependency, which you can find below :

<dependency>
   <groupId>org.hibernate</groupId>
   <artifactId>hibernate-commons-annotations</artifactId>
   <version>3.2.0</version>
</dependency>

<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-annotations</artifactId>
    <version>3.5.5-Final</version>
</dependency>


<dependency>
  <groupId>org.hibernate</groupId>
  <artifactId>hibernate-entitymanager</artifactId>
  <version>5.2.9.Final</version>
</dependency>

and if you are not using maven project then you need to download the hibernate-entitymanager and hibernate-annotations jar and add into build path and rebuild the project

Anshul Sharma
  • 3,432
  • 1
  • 12
  • 17