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

Hibernate with Tomcat

 
Saumya Nair
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,


I am using hibernate with Tomcat. All the hibernate files are defined in a 'config' folder on the WEB-INF,src,.. level. I am not able to build the session factory even if i give the entire path while configuring.


Please help

Regards,
Saumya
 
Prabhu Venkatachalam
Ranch Hand
Posts: 502
Java jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please post the error you are getting while building session factory and the source code.
 
pascal betz
Ranch Hand
Posts: 547
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the config file (hibernate.cfg.xml) needs to be on the classpath.
The "src" tree is (usualy) not deployed to the server.

And yes, give the full stacktrace and may be a bit more detailed description of your file system layout!


pascal
 
Edward Durai
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Are you using Any Java IDE. or are you creating manual project creation? Please check all the files and folders available. Please mention the exact problem you are facing. Then only we can help you.
 
Saumya Nair
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
File not found error... does not get the location of hibernate.cfg.cml file
 
Saumya Nair
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Temporarily have placed the files in the classes dir of WEB_INF.. but would like to know how to obtain the hbm files that have been placed in a separate folder.. which does not lie in the output folder directory
 
Edward Durai
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

My sample application working fine.
My folder struture looks like

src(folder)
-com (folder)
-all the hbm files and getter setter files
-Userlogin.hbm.xml
-Userlogin.java (contains setter and getter method)
-Auditfinding.hbm.xml
-Auditfinding.java (contains setter and getter method)
hibernate-cfg.xml

In hibernate-cfg.xml you should mention the correct path of hbm file

like



Hope it is useful for you. Thanks

Thanks
[ February 22, 2007: Message edited by: Edward Durai ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic