-->
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.  [ 2 posts ] 
Author Message
 Post subject: Stuck while creating sessionFactory
PostPosted: Fri Aug 27, 2010 5:27 pm 
Newbie

Joined: Fri Aug 27, 2010 5:22 pm
Posts: 1
Hi, while creating sessionFactory, it get stucked and nothing happens.

Code snippet:

1) System.out.println("creating session factory");
2) SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();
3) System.out.println("session factory created");
-----------------------------------------------------
Console Output: It stucks at line 2 above and doesnt come out even after waiting for 10-15 mins.

creating session factory
log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
----------------------------------------------
config file:

<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost/hibernatetutorial</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">welcome123</property>
<property name="hibernate.connection.pool_size">2</property>
<property name="show_sql">true</property>
<property name="dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
<property name="hibernate.hbm2ddl.auto">update</property>
<!-- Mapping files -->
<mapping resource="contact.hbm.xml"/>
</session-factory>
</hibernate-configuration>

Please help.


Top
 Profile  
 
 Post subject: Re: Stuck while creating sessionFactory
PostPosted: Fri Aug 27, 2010 7:05 pm 
Regular
Regular

Joined: Sun Feb 14, 2010 3:29 pm
Posts: 58
Location: USA
your program likely hit some errors or having problems during start up. Try adding proper log4j.properties file in your classpath and watch more details log output. Ensure to enable org.hibernate logger level to INFO or lower. You shouldn't see these
Code:
log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.

_________________
Zemian Deng
------------
Need a Java Scheduler? Try
http://bitbucket.org/timemachine/scheduler


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