-->
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.  [ 7 posts ] 
Author Message
 Post subject: buildSessionFactory hangs on building session factory
PostPosted: Thu Nov 12, 2009 12:37 pm 
Newbie

Joined: Thu Nov 12, 2009 11:59 am
Posts: 2
Hi,

im trying to initialize a session factory via:

sessionFactory = new Configuration().configure("db.cfg.xml").buildSessionFactory();

This is my db.cfg.xml:

<?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>

<!-- Database connection settings -->
<property name="hibernate.connection.url">jdbc:mysql://DB-MYSQL:3306/db300</property>
<property name="hibernate.connection.username">db300</property>
<property name="hibernate.connection.password">db300</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>

<property name="hibernate.current_session_context_class">thread</property>

<property name="hibernate.show_sql">true</property>
<property name="hibernate.format_sql">true</property>

<mapping resource="com/gourmet/db300base/pb/database/mapping/AlignService.hbm.xml" />
</session-factory>
</hibernate-configuration>

My environment is:

Apache Tomcat/6.0.18
Sun jdk1.5.0_19
RedHat AS 5.0
mysql-connector-java-5.1.10
Hibernate Core 3.2.6GA
Hibernate Entity Manager (javax.persistence jar only) 3.3.1GA

I can't obtain a session factory because the Hibernate Environment loading process hangs on this line:

    2009-11-12 17:11:14,100 86674 INFO [org.hibernate.impl.SessionFactoryImpl]:161 building session factory

This is the complete log:

2009-11-12 17:11:12,932 85506 INFO [org.hibernate.cfg.Environment]:514 Hibernate 3.2.6
2009-11-12 17:11:12,936 85510 INFO [org.hibernate.cfg.Environment]:547 hibernate.properties not found
2009-11-12 17:11:12,940 85514 INFO [org.hibernate.cfg.Environment]:681 Bytecode provider name : cglib
2009-11-12 17:11:12,944 85518 INFO [org.hibernate.cfg.Environment]:598 using JDK 1.4 java.sql.Timestamp handling
2009-11-12 17:11:12,996 85570 INFO [org.hibernate.cfg.Configuration]:1432 configuring from resource: sn300.cfg.xml
2009-11-12 17:11:12,998 85572 INFO [org.hibernate.cfg.Configuration]:1409 Configuration resource: sn300.cfg.xml
2009-11-12 17:11:13,052 85626 INFO [org.hibernate.cfg.Configuration]:559 Reading mappings from resource : com/gourmet/db300base/pb/database/mapping/AlignService.hbm.xml
2009-11-12 17:11:13,125 85699 INFO [org.hibernate.cfg.HbmBinder]:300 Mapping class: com.gourmet.sn300base.pb.database.mapping.AlignService -> ALIGN_SERVICE
2009-11-12 17:11:13,902 86476 INFO [org.hibernate.cfg.Configuration]:1547 Configured SessionFactory: null
2009-11-12 17:11:14,001 86575 INFO [org.hibernate.connection.DriverManagerConnectionProvider]:41 Using Hibernate built-in connection pool (not for production use!)
2009-11-12 17:11:14,002 86576 INFO [org.hibernate.connection.DriverManagerConnectionProvider]:42 Hibernate connection pool size: 20
2009-11-12 17:11:14,003 86577 INFO [org.hibernate.connection.DriverManagerConnectionProvider]:45 autocommit mode: false
2009-11-12 17:11:14,004 86578 INFO [org.hibernate.connection.DriverManagerConnectionProvider]:80 using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://DB300-MYSQL:3306/db300
2009-11-12 17:11:14,005 86579 INFO [org.hibernate.connection.DriverManagerConnectionProvider]:86 connection properties: {user=db300, password=****}
2009-11-12 17:11:14,017 86591 INFO [org.hibernate.cfg.SettingsFactory]:89 RDBMS: MySQL, version: 5.1.36-community
2009-11-12 17:11:14,018 86592 INFO [org.hibernate.cfg.SettingsFactory]:90 JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.1.10 ( Revision: ${svn.Revision} )
2009-11-12 17:11:14,034 86608 INFO [org.hibernate.dialect.Dialect]:152 Using dialect: org.hibernate.dialect.MySQLDialect
2009-11-12 17:11:14,039 86613 INFO [org.hibernate.transaction.TransactionFactoryFactory]:31 Using default transaction strategy (direct JDBC transactions)
2009-11-12 17:11:14,041 86615 INFO [org.hibernate.transaction.TransactionManagerLookupFactory]:33 No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
2009-11-12 17:11:14,042 86616 INFO [org.hibernate.cfg.SettingsFactory]:143 Automatic flush during beforeCompletion(): disabled
2009-11-12 17:11:14,043 86617 INFO [org.hibernate.cfg.SettingsFactory]:147 Automatic session close at end of transaction: disabled
2009-11-12 17:11:14,044 86618 INFO [org.hibernate.cfg.SettingsFactory]:154 JDBC batch size: 15
2009-11-12 17:11:14,045 86619 INFO [org.hibernate.cfg.SettingsFactory]:157 JDBC batch updates for versioned data: disabled
2009-11-12 17:11:14,046 86620 INFO [org.hibernate.cfg.SettingsFactory]:162 Scrollable result sets: enabled
2009-11-12 17:11:14,047 86621 INFO [org.hibernate.cfg.SettingsFactory]:170 JDBC3 getGeneratedKeys(): enabled
2009-11-12 17:11:14,048 86622 INFO [org.hibernate.cfg.SettingsFactory]:178 Connection release mode: auto
2009-11-12 17:11:14,049 86623 INFO [org.hibernate.cfg.SettingsFactory]:202 Maximum outer join fetch depth: 2
2009-11-12 17:11:14,050 86624 INFO [org.hibernate.cfg.SettingsFactory]:205 Default batch fetch size: 1
2009-11-12 17:11:14,051 86625 INFO [org.hibernate.cfg.SettingsFactory]:209 Generate SQL with comments: disabled
2009-11-12 17:11:14,052 86626 INFO [org.hibernate.cfg.SettingsFactory]:213 Order SQL updates by primary key: disabled
2009-11-12 17:11:14,053 86627 INFO [org.hibernate.cfg.SettingsFactory]:217 Order SQL inserts for batching: disabled
2009-11-12 17:11:14,054 86628 INFO [org.hibernate.cfg.SettingsFactory]:386 Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
2009-11-12 17:11:14,057 86631 INFO [org.hibernate.hql.ast.ASTQueryTranslatorFactory]:24 Using ASTQueryTranslatorFactory
2009-11-12 17:11:14,058 86632 INFO [org.hibernate.cfg.SettingsFactory]:225 Query language substitutions: {}
2009-11-12 17:11:14,059 86633 INFO [org.hibernate.cfg.SettingsFactory]:230 JPA-QL strict compliance: disabled
2009-11-12 17:11:14,059 86633 INFO [org.hibernate.cfg.SettingsFactory]:235 Second-level cache: enabled
2009-11-12 17:11:14,060 86634 INFO [org.hibernate.cfg.SettingsFactory]:239 Query cache: disabled
2009-11-12 17:11:14,061 86635 INFO [org.hibernate.cfg.SettingsFactory]:373 Cache provider: org.hibernate.cache.NoCacheProvider
2009-11-12 17:11:14,062 86636 INFO [org.hibernate.cfg.SettingsFactory]:254 Optimize cache for minimal puts: disabled
2009-11-12 17:11:14,063 86637 INFO [org.hibernate.cfg.SettingsFactory]:263 Structured second-level cache entries: disabled
2009-11-12 17:11:14,068 86642 INFO [org.hibernate.cfg.SettingsFactory]:283 Echoing all SQL to stdout
2009-11-12 17:11:14,069 86643 INFO [org.hibernate.cfg.SettingsFactory]:290 Statistics: disabled
2009-11-12 17:11:14,070 86644 INFO [org.hibernate.cfg.SettingsFactory]:294 Deleted entity synthetic identifier rollback: disabled
2009-11-12 17:11:14,071 86645 INFO [org.hibernate.cfg.SettingsFactory]:309 Default entity-mode: pojo
2009-11-12 17:11:14,072 86646 INFO [org.hibernate.cfg.SettingsFactory]:313 Named query checking : enabled
2009-11-12 17:11:14,100 86674 INFO [org.hibernate.impl.SessionFactoryImpl]:161 building session factory <<<<---- this is the last line

I have to restart Tomcat to unlock the application. Nothing functions anymore after this operation.

Thanks

Cristallo


Top
 Profile  
 
 Post subject: Re: buildSessionFactory hangs on building session factory
PostPosted: Fri Nov 13, 2009 10:58 am 
Newbie

Joined: Mon Jan 10, 2005 10:42 am
Posts: 6
Which version of mysql are you using? See from https://www.hibernate.org/80.html the 5.1 is not supported (latest is 5.0).

Any expert tips?

Thanks

Michele


Top
 Profile  
 
 Post subject: Re: buildSessionFactory hangs on building session factory
PostPosted: Tue Feb 16, 2010 2:33 pm 
Newbie

Joined: Sat Nov 22, 2008 7:45 am
Posts: 3
Hello,

Have you solved your problem ?
I have the exact same problem... I changed nothing (I think) in my code and my configuration and today, impossible to launch my J2SE configuration, the program hanging on:

19:26:39,291 INFO SessionFactoryImpl:193 - building session factory

Regards,

Fred


Top
 Profile  
 
 Post subject: Re: buildSessionFactory hangs on building session factory
PostPosted: Wed Feb 17, 2010 5:08 am 
Newbie

Joined: Thu Nov 12, 2009 11:59 am
Posts: 2
Hi,

The problem has magically disappeared clearing the resolv.conf file from unnecessary values. After you have cleaned up the file even simple ssh connections have improved in speed.

Bye

Cristallo


Top
 Profile  
 
 Post subject: Re: buildSessionFactory hangs on building session factory
PostPosted: Wed Feb 17, 2010 5:31 am 
Newbie

Joined: Sat Nov 22, 2008 7:45 am
Posts: 3
Hi !

Thanks for your answer... I replace some files from my eclipse history. The problem is now solved but replaced by another one...

Now, not hanging but keep LOOPING, it's never ends, always binding entities and queries. Building session factory and redo it again, again and again ...

Bad days for hibernates configuration in my mac...


I'am sure it's little tricky thing.


Top
 Profile  
 
 Post subject: Re: buildSessionFactory hangs on building session factory
PostPosted: Wed Mar 10, 2010 7:44 am 
Newbie

Joined: Fri Jun 26, 2009 9:39 am
Posts: 1
Hello,

I had an issue like this, the tomcat startup hangs at "building session factory" but the startup continues after 10 or 15 minutes and all the things are ok, after a few days of headaches I figured out that in /etc/hosts I had 193.104.211.80 wb2 instead of 193.104.211.85 wb2 ( 193.104.211.85 is the real ip of eth0 )


Top
 Profile  
 
 Post subject: Re: buildSessionFactory hangs on building session factory
PostPosted: Mon Jul 21, 2014 12:59 pm 
Newbie

Joined: Mon Jul 21, 2014 12:50 pm
Posts: 1
Hi all,
surfing on the web I've seen this post.
I've the same BIG problem.

I've SPRING 4.0.5.RELEASE
Hibernate 3
Jboss 6.0.0.FINAL
JPA

Same problem on building session factory.
In which way have you managed to solve the problem?

If you want I can also post my configurations.
Please help :(


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