Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Folder Structure for a Hibernate Web Application

 
Nuwan Arambage
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, all

I have tried to test the simple application (Like login) but I couldn't run the application.. Can somebody clearly specify
where is the location I need to place the "hibernate config" & "hibernate mapping " xml files.

& By the way I need to know what are the minimum jar files needed to run the hibernate application.....



 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I almost always just put them at the root of the classpath.

The Hibernate docs list what libraries are required, and I believe the distribution includes them as well. Without even knowing what version of Hibernate you're using, though, it's difficult to help.
 
Victor Ramen
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes...root of classpath is a safe bet I think. So this means under 'src' so when you compile, they go under WEB-INF/classes.

Roy
 
vijin das
Ranch Hand
Posts: 129
Firefox Browser Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
XML configuration file of Hibernate, “hibernate.cfg.xml” should always be placed at the root of the classpath, outside of any package.
If you misplaced this configuration file into a other directory, you may get a error like this :
"Initial SessionFactory creation failed " ..
If you prefer Hibernate to locate for your “hibernate.cfg.xml” file in a sub-package of your classpath,
you need to do some modification to the Hibernate’s SessionFactory class by providing your “hibernate.cfg.xml” file path as an argument to
the configure() method:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic