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.cfg.xml

 
zuo liao
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a jar(common.jar) file which will be used by all the J2EE applications. I put it under WebSphere\AppServer\lib\ext folder. The hibernate.cfg.xml is in common.jar.

If we have J2EE application which also use hibernate, it has its own hibernate.cfg.xml. Will hibernate.cfg.xml in common.jar affect hibernate.cfg.xml in the J2EE application? Thanks.
 
Edvins Reisons
Ranch Hand
Posts: 364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe that, unless you specify otherwise, the application will use the configuration file on the root of its classpath and ignore the one in common.jar.
 
zuo liao
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks,Edvins. You are right.

I find this: When configure() is called, Hibernate searches for a file named hibernate.cfg.xml in the root of the classpath
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic