Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Class HibernateUtil cannot be resolved

 
Rahul somanath
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All

I am trying to execute my first program on Hibernate. I am executing the HelloWorld program in the book "Java persistance with hibernate".
I have downloaded hibernate-distribution-3.5.2-Final i have taken all the jar files under the folder "hibernate-distribution-3.5.2-Final\lib\required" and added them to the class path

I am trying to execute the program



But i am getting the error Unable to resolve the class HibernateUtil. Please let help me in resolving this problem

Thanks in advance
Fierof2
 
Rahul somanath
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its a compile time exception that i am getting. The eclipse is not resolving the import statement.

I dont know under which jar is the HibernateUtil.java file is

The required folder under hibernate-distribution-3.5.2-Final-dist\hibernate-distribution-3.5.2-Final\lib\required contains the following jars

antlr-2.7.6.jar
commons-collections-3.1.jar
dom4j-1.6.1.jar
javassist-3.9.0.GA.jar
jta-1.1.jar
slf4j-api-1.5.8.jar
 
Rahul somanath
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have also added the hibernate3.jar file to the class path and i am still facing the same problem.
 
Subhendu Mahanta
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is your HibernateUtil class:

 
Rahul somanath
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thnaks a lot Subhendu.

Just now i came to know that tThe HibernateUtil is a separate Java file provided by the Book. I went to their site and got this file.

Instead of providing the java file you could have mention this info and it would have made me clear.

Thanks a lot for for the assistance.

Thanks and Regards
 
Subhendu Mahanta
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is also available in Hibernate reference http://docs.jboss.org/hibernate/core/3.5/reference/en/html/tutorial.html section 1.1.6. Startup and helpers.
Because reference is also written by same people: Christian Bauer & Gavin King.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic