cancel
Showing results for 
Search instead for 
Did you mean: 

problem with hibernate.cfg.xml

former_member219446
Participant
0 Kudos

Hi All,

I want to use hibernate instead of entity bean in my EJB project,

I have tried and succeded the hibernate example with servlet .

But with EJB project i got exception hibernate.cfg.xml is not found ,

In the Web Project i placed the hibernate.cfg.xml file in WEB-INF-->classes.

my doubt is where to place the hibernate.cfg.xml file in the EJB Project.and how to configure that file.

Any help is appreciated.

Thanks & Regards

Srinivas

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

I succeed in configuration of Hibernate. My configuration file is in dist/PORTAL-INF/classes.

Julien

Former Member
0 Kudos

I think this document will be helpful http://wiki.java.net/bin/view/Projects/ConfigureHibernate

It suggest to have the following structure of ejb jar:

<i>META-INF/MANIFEST.MF

META-INF/ejb-jar.xml

META-INF/sun-ejb-jar.xml

<application classes>

hibernate2.jar

Customer.hbm.xml

hibernate.cfg.xml

dom4j-1.4.jar

jta.jar

log4j-1.2.8.jar

cglib-full-2.0.2.jar

odmg-3.0.jar

ehcache-0.9.jar

commons-collections-2.1.1.jar

commons-dbcp-1.2.1.jar

commons-lang-1.0.1.jar

commons-logging-1.0.4.jar

commons-pool-1.2.jar</i>

Your EJB project doesn't have acces to your WAR classpath.