-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: "hibernate.cfg.xml file not found"
PostPosted: Mon Apr 12, 2004 6:23 am 
Newbie

Joined: Sun Apr 04, 2004 5:00 am
Posts: 13
dear seniors...

i have tried a lot of example aplications using hibernate.
but i couldnt solve the errors i am getting when applied.
most of them are using ANT build type applications...

so i tried by myself doing some small applciation
to update some values to a table in our Database.
today i did that thing and its working !
but i am getting an exception like this....

Caused by: java.lang.RuntimeException: Exception building SessionFactory: /hibernate.cfg.xml not found
at com.celestials.celeshibdemo.HibernateUtil.(HibernateUtil.java:14)
... 38 more
Caused by: net.sf.hibernate.HibernateException: /hibernate.cfg.xml not found


but i have hibernate.cfg.xml in webapps/celeshibdemo/web-inf/classes/ directory.


and my hibernate.cfg.xml contents are...

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration
PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.datasource">java:comp/env/jdbc/celeshibdemo</property>
<property name="show_sql">false</property>
<property name="dialect">net.sf.hibernate.dialect.MySQLDialect</property>
<!-- Mapping files -->
<mapping resource="Cat.hbm.xml"/>
</session-factory>
</hibernate-configuration>

the red marked thing is done in tomcat4/conf/server.xml file...
those lines are....


<!--- added by Munas for implementing Tomcat - JDBC Connection Pool -->
<Context path="/celeshibdemo" docBase="celeshibdemo">
<Resource name="jdbc/celeshibdemo" scope="Shareable" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/celeshibdemo">
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<!-- DBCP database connection settings -->
<parameter>
<name>url</name>
<value>jdbc:mysql://10.200.50.2/pos</value>
</parameter>
<parameter>
<name>driverClassName</name><value>com.mysql.jdbc.Driver</value>
</parameter>
<parameter>
<name>username</name>
<value>celestials</value>
</parameter>
<parameter>
<name>password</name>
<value>passward</value>
</parameter>
<!-- DBCP connection pooling options -->
<parameter>
<name>maxWait</name>
<value>3000</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>100</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>10</value>
</parameter>
</ResourceParams>
</Context>

--------------------------------

can u pls help me in getting this error out.


-Munas.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.