aspose file tools*
The moose likes Object Relational Mapping and the fly likes Class HibernateUtil cannot be resolved Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Class HibernateUtil cannot be resolved" Watch "Class HibernateUtil cannot be resolved" New topic
Author

Class HibernateUtil cannot be resolved

Rahul somanath
Greenhorn

Joined: Jul 12, 2010
Posts: 19
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

Joined: Jul 12, 2010
Posts: 19
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

Joined: Jul 12, 2010
Posts: 19
I have also added the hibernate3.jar file to the class path and i am still facing the same problem.
Subhendu Mahanta
Greenhorn

Joined: Jan 28, 2011
Posts: 5
Here is your HibernateUtil class:

Rahul somanath
Greenhorn

Joined: Jul 12, 2010
Posts: 19
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

Joined: Jan 28, 2011
Posts: 5
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Class HibernateUtil cannot be resolved