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 lineI have to restart Tomcat to unlock the application. Nothing functions anymore after this operation.
Thanks
Cristallo