-->
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.  [ 5 posts ] 
Author Message
 Post subject: Initial SessionFactory creation failed /hibernate.cfg.xml
PostPosted: Thu Mar 09, 2006 5:44 pm 
Newbie

Joined: Thu Mar 09, 2006 5:39 pm
Posts: 7
Hi,

I am trying to Run my first Hibernate Program using Eclipse and Hibernate 3.2...I have following directory structure:

C:\hibernate-3.1\Projects\Source\com\Examples

In Examples I have all my Files (.java, .class and .xml)

My Hibernate.cfg.xml look like this
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">com.microsoft.jdbc.sqlserver.SQLServerDriver</property>
<property name="hibernate.connection.url">jdbc:microsoft:sqlserver://cnp290:1433;databaseName=P3EWM_Indus;SelectMethod=Cursor</property>
<property name="hibernate.connection.username">IFW_User</property>
<property name="hibernate.connection.password">FW$user1</property>
<property name="dialect">org.hibernate.dialect.SQLServerDialect</property>
<property name="show_sql">false</property>
<mapping resource="Source/com/Examples/Event.hbm.xml"/>
</session-factory>
</hibernate-configuration>

I am getting an error that Hibernate.cfg.xml can not be found.
I am using Eclipse to compile and run my code.
Build is Successful but Run time its failing.

Advise. Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 09, 2006 5:52 pm 
Expert
Expert

Joined: Mon Jan 09, 2006 5:01 pm
Posts: 311
Location: Sacramento, CA
is your classpath setup properly ? ie the config file directory is in the classpath?

_________________
-JT

If you find my replies helpful, please rate by clicking 'Y' on them. I appreciate it.


Top
 Profile  
 
 Post subject: HibernateException: /hibernate.cfg.xml not found
PostPosted: Thu Mar 09, 2006 5:57 pm 
Newbie

Joined: Thu Mar 09, 2006 5:39 pm
Posts: 7
Hi,

The path of the folder containing hibernate.cfg.xml is in classpath. Still I am getting the same error.

Any help appreciated.

thanks
jitender


Top
 Profile  
 
 Post subject: HibernateException: /hibernate.cfg.xml not found
PostPosted: Thu Mar 09, 2006 5:59 pm 
Newbie

Joined: Thu Mar 09, 2006 5:39 pm
Posts: 7
Hi,

The path of the folder containing hibernate.cfg.xml is in classpath. Still I am getting the same error.

Any help appreciated.

thanks
jitender


Top
 Profile  
 
 Post subject: Suceess
PostPosted: Thu Mar 09, 2006 6:04 pm 
Newbie

Joined: Thu Mar 09, 2006 5:39 pm
Posts: 7
I moved the xml files to other directory...it worked....
i was able to insert data in SQL Server tables using EClipse IDE.

thanks
jitender


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

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.