-->
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.  [ 6 posts ] 
Author Message
 Post subject: Regarding Configuration in hibernate.cfg.xml file
PostPosted: Fri Aug 12, 2005 7:14 am 
Beginner
Beginner

Joined: Fri Aug 12, 2005 7:05 am
Posts: 25
Location: TamilNadu
Hai All friends !
I am new for Hibernate.i have install hibernate 3.1 in d: and using eclipse platform for java.now i configure hibernate.cfg.xml file as following manner..

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/gametrixinc</property>
<property name="hibernate.connection.username">gametrixinc</property>
<property name="hibernate.connection.password">arena</property>
<property name="hibernate.connection.pool_size">10</property>
<property name="show_sql">true</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.hbm2ddl.auto">update</property>
<!-- Mapping files -->
<mapping resource="CD.hbm.xml"/>
</session-factory>
</hibernate-configuration>




and i m using MySql as backend.eclipse installed in c: and write simple java application CD(in Wrox) and run it now

problem is


log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).

log4j:WARN Please initialize the log4j system properly.

Error org.hibernate.HibernateException: Hibernate Dialect must be explicitly set


Thanx & regards

Shanmugam


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 12, 2005 8:04 am 
Expert
Expert

Joined: Thu Sep 04, 2003 8:23 am
Posts: 368
Are you sure your hibernate.cfg.xml is in a src directory an thus is deploy on your classpath when you build your project (same pb with log4j.properties)

_________________
Seb
(Please don't forget to give credits if you found this answer useful :)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 12, 2005 8:13 am 
Expert
Expert

Joined: Thu Dec 04, 2003 12:36 pm
Posts: 275
Location: Bielefeld, Germany
Leave out all the "hibernate." in your hibernate.cfg.xml.

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
<session-factory>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://localhost:3306/gametrixinc</property>
<property name="connection.username">gametrixinc</property>
<property name="connection.password">arena</property>
<property name="connection.pool_size">10</property>
<property name="show_sql">true</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hbm2ddl.auto">update</property>
<!-- Mapping files -->
<mapping resource="CD.hbm.xml"/>
</session-factory>
</hibernate-configuration>

Best regards
Sven


Top
 Profile  
 
 Post subject: Regarding Configuration in hibernate.cfg.xml file-Reply
PostPosted: Fri Aug 12, 2005 9:43 am 
Beginner
Beginner

Joined: Fri Aug 12, 2005 7:05 am
Posts: 25
Location: TamilNadu
scesbron wrote:
Are you sure your hibernate.cfg.xml is in a src directory an thus is deploy on your classpath when you build your project (same pb with log4j.properties)



HI!
First Thnx for reply.copied cofig file to workspace in eclipse (sorce file dir).but again the same problem raised.


Thanx


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 12, 2005 9:45 am 
Beginner
Beginner

Joined: Fri Aug 12, 2005 7:05 am
Posts: 25
Location: TamilNadu
sven wrote:
Leave out all the "hibernate." in your hibernate.cfg.xml.

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
<session-factory>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://localhost:3306/gametrixinc</property>
<property name="connection.username">gametrixinc</property>
<property name="connection.password">arena</property>
<property name="connection.pool_size">10</property>
<property name="show_sql">true</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hbm2ddl.auto">update</property>
<!-- Mapping files -->
<mapping resource="CD.hbm.xml"/>
</session-factory>
</hibernate-configuration>

Best regards
Sven




Thnx for reply
Again the same problem raised ..

Regards
Shanmugam


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 12, 2005 10:13 am 
Expert
Expert

Joined: Thu Dec 04, 2003 12:36 pm
Posts: 275
Location: Bielefeld, Germany
The files (hibernate.cfg.xml and log4j.properties) have to be in your classpath.

Show your file structure as well as your hibernate.properties.

Best regards
Sven


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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.