I've got a strange problem that I can't seem to place. Yesterday I was using Gentoo on this system and had my development env. working great...my application was running fine and I left off w/ it running just fine.
I wiped my system and installed Ubuntu...reinstalled my application and now I'm getting a new Hibernate exception I've never seen. I had the application working in both mysql 4.1 and postgresql 8.0 and now I get the same exception when using either of these databases. I have no problem using other tools to connect to them so I know it's not the database servers themselves (e.g. pgadmin, netbeans, and the mysql client all work when connecting.)
The correct driver(s) are in place in common/lib in Tomcat (5.5.9).
So, long story short - I literally dragged & dropped a fully working application into a new environment and it's bombing. It appears to be something w/ c3po but like I said...it ran fine on Gentoo 24 hrs. ago and this is the latest release of Hibernate.
Posted below are the details, including the full stack-trace.
Any ideas?
Hibernate version: 3.1
Hibernate config:
Code:
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.driver_class">org.postgresql.Driver</property>
<property name="connection.url">jdbc:postgresql://localhost/app</property>
<property name="connection.username">speak_up</property>
<property name="connection.password">xxx</property>
<property name="connection.pool_size">15</property>
<property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
<property name="show_sql">true</property>
<mapping resource="net/app/bol/Blog.hbm.xml"/>
<mapping resource="net/app/bol/Category.hbm.xml"/>
<mapping resource="net/app/bol/Entry.hbm.xml"/>
<mapping resource="net/app/bol/Message.hbm.xml"/>
<mapping resource="net/app/bol/User.hbm.xml"/>
<mapping resource="net/app/bol/UserGroup.hbm.xml"/>
</session-factory>
</hibernate-configuration>
Full stack trace of any exception that occurs:Code:
INFO: Server startup in 1565 ms
13:26:26,735 INFO Environment:479 - Hibernate 3.1
13:26:26,746 INFO Environment:494 - loaded properties from resource hibernate.properties: {hibernate.c3p0.timeout=5000, hibernate.default_batch_fetch_size=8, hibernate.connection.driver_class=org.postgresql.Driver, hibernate.cglib.use_reflection_optimizer=true, hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider, hibernate.c3p0.max_statements=50, hibernate.max_fetch_depth=1, hibernate.c3p0.max_size=30, hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect, hibernate.c3p0.idle_test_period=3000, hibernate.jdbc.use_streams_for_binary=true, hibernate.c3p0.min_size=5, hibernate.query.substitutions=true 1, false 0, yes 'Y', no 'N', hibernate.cache.region_prefix=hibernate.test, hibernate.jdbc.batch_versioned_data=true, hibernate.connection.pool_size=15}
13:26:26,748 INFO Environment:524 - using java.io streams to persist binary types
13:26:26,748 INFO Environment:525 - using CGLIB reflection optimizer
13:26:26,750 INFO Environment:555 - using JDK 1.4 java.sql.Timestamp handling
13:26:26,844 INFO Configuration:1286 - configuring from resource: /hibernate.cfg.xml
13:26:26,845 INFO Configuration:1263 - Configuration resource: /hibernate.cfg.xml
13:26:26,943 ERROR DTDEntityResolver:51 - Don't use old DTDs, read the Hibernate 3.x Migration Guide!
13:26:27,138 INFO Configuration:468 - Reading mappings from resource: net/app/bol/Blog.hbm.xml
13:26:27,295 INFO HbmBinder:265 - Mapping class: net.app.bol.Blog -> blog
13:26:27,350 INFO Configuration:468 - Reading mappings from resource: net/app/bol/Category.hbm.xml
13:26:27,403 INFO HbmBinder:265 - Mapping class: net.app.bol.Category -> category
13:26:27,511 INFO Configuration:468 - Reading mappings from resource: net/app/bol/Entry.hbm.xml
13:26:27,560 INFO HbmBinder:265 - Mapping class: net.app.bol.Entry -> entry
13:26:27,565 INFO Configuration:468 - Reading mappings from resource: net/app/bol/Message.hbm.xml
13:26:27,587 INFO HbmBinder:265 - Mapping class: net.app.bol.Message -> entry_message
13:26:27,589 INFO Configuration:468 - Reading mappings from resource: net/app/bol/User.hbm.xml
13:26:27,606 INFO HbmBinder:265 - Mapping class: net.app.bol.User -> user
13:26:27,611 INFO Configuration:468 - Reading mappings from resource: net/app/bol/UserGroup.hbm.xml
13:26:27,638 INFO HbmBinder:265 - Mapping class: net.app.bol.UserGroup -> user_group
13:26:27,640 INFO Configuration:1397 - Configured SessionFactory: null
13:26:27,645 INFO Configuration:1022 - processing extends queue
13:26:27,653 INFO Configuration:1026 - processing collection mappings
13:26:27,654 INFO HbmBinder:2276 - Mapping collection: net.app.bol.Blog.Categories -> category
13:26:27,657 INFO HbmBinder:2276 - Mapping collection: net.app.bol.Category.Entries -> entry
13:26:27,658 INFO HbmBinder:2276 - Mapping collection: net.app.bol.Entry.Messages -> entry
13:26:27,659 INFO HbmBinder:2276 - Mapping collection: net.app.bol.UserGroup.Users -> user
13:26:27,660 INFO Configuration:1035 - processing association property references
13:26:27,661 INFO Configuration:1057 - processing foreign key constraints
13:26:27,681 INFO C3P0ConnectionProvider:50 - C3P0 using driver: org.postgresql.Driver at URL: jdbc:postgresql://localhost/app
13:26:27,682 INFO C3P0ConnectionProvider:51 - Connection properties: {user=speak_up, password=****}
13:26:27,684 INFO C3P0ConnectionProvider:54 - autocommit mode: false
13:26:57,279 WARN BasicResourcePool:1222 - [b]com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@12368df -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30).[/b]
13:26:57,284 WARN BasicResourcePool:1222 - com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@3caa4b -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30).
13:26:57,290 WARN SettingsFactory:103 - Could not obtain connection metadata
java.sql.SQLException: Connections could not be acquired from the underlying database!
at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:104)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:236)
at com.mchange.v2.c3p0.PoolBackedDataSource.getConnection(PoolBackedDataSource.java:94)
at org.hibernate.connection.C3P0ConnectionProvider.getConnection(C3P0ConnectionProvider.java:35)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:72)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1859)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1152)
at net.app.data.HibernateUtil.<clinit>(HibernateUtil.java:71)
at net.app.dao.BaseDAO.<init>(BaseDAO.java:39)
at net.app.dao.BlogDAO.<init>(BlogDAO.java:34)
at net.app.proxy.BlogProxy.flush(BlogProxy.java:52)
at net.app.speakup.SpeakUpFilter.doFilter(SpeakUpFilter.java:34)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
[b]Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.[/b]
at com.mchange.v2.resourcepool.BasicResourcePool.awaitAcquire(BasicResourcePool.java:970)
at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:208)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:232)
... 27 more
13:26:57,318 INFO Dialect:103 - Using dialect: org.hibernate.dialect.PostgreSQLDialect
13:26:57,328 INFO TransactionFactoryFactory:31 - Using default transaction strategy (direct JDBC transactions)
13:26:57,333 INFO TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
13:26:57,339 INFO SettingsFactory:125 - Automatic flush during beforeCompletion(): disabled
13:26:57,341 INFO SettingsFactory:129 - Automatic session close at end of transaction: disabled
13:26:57,343 INFO SettingsFactory:144 - Scrollable result sets: disabled
13:26:57,343 INFO SettingsFactory:152 - JDBC3 getGeneratedKeys(): disabled
13:26:57,344 INFO SettingsFactory:160 - Connection release mode: auto
13:26:57,345 INFO SettingsFactory:184 - Maximum outer join fetch depth: 1
13:26:57,346 INFO SettingsFactory:187 - Default batch fetch size: 8
13:26:57,346 INFO SettingsFactory:191 - Generate SQL with comments: disabled
13:26:57,346 INFO SettingsFactory:195 - Order SQL updates by primary key: disabled
13:26:57,347 INFO SettingsFactory:338 - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
13:26:57,354 INFO ASTQueryTranslatorFactory:21 - Using ASTQueryTranslatorFactory
13:26:57,355 INFO SettingsFactory:203 - Query language substitutions: {no='N', true=1, yes='Y', false=0}
13:26:57,356 INFO SettingsFactory:209 - Second-level cache: enabled
13:26:57,356 INFO SettingsFactory:213 - Query cache: disabled
13:26:57,357 INFO SettingsFactory:325 - Cache provider: org.hibernate.cache.HashtableCacheProvider
13:26:57,360 INFO SettingsFactory:228 - Optimize cache for minimal puts: disabled
13:26:57,361 INFO SettingsFactory:233 - Cache region prefix: hibernate.test
13:26:57,366 INFO SettingsFactory:237 - Structured second-level cache entries: disabled
13:26:57,377 INFO SettingsFactory:257 - Echoing all SQL to stdout
13:26:57,378 INFO SettingsFactory:264 - Statistics: disabled
13:26:57,378 INFO SettingsFactory:268 - Deleted entity synthetic identifier rollback: disabled
13:26:57,379 INFO SettingsFactory:283 - Default entity-mode: pojo
13:26:57,432 INFO SessionFactoryImpl:153 - building session factory
13:26:58,275 INFO SessionFactoryObjectFactory:82 - Not binding factory to JNDI, no JNDI name configured
13:26:58,280 INFO SessionFactoryImpl:353 - Checking 0 named HQL queries
13:26:58,280 INFO SessionFactoryImpl:373 - Checking 0 named SQL queries
13:27:27,466 WARN BasicResourcePool:1222 - com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@4eeaaf -- [b]Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30).[/b]
13:27:27,473 WARN JDBCExceptionReporter:71 - SQL Error: 0, SQLState: null
13:27:27,474 ERROR JDBCExceptionReporter:72 - Connections could not be acquired from the underlying database!
13:27:27,502 ERROR [jsp]:260 - Servlet.service() for servlet jsp threw exception
org.hibernate.exception.GenericJDBCException: Cannot open connection
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:91)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:79)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:318)
at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:109)
at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:137)
at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:57)
at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1262)
at net.app.data.HibernateUtil.beginTransaction(HibernateUtil.java:252)
at net.app.dao.BaseDAO.<init>(BaseDAO.java:39)
at net.app.dao.BlogDAO.<init>(BlogDAO.java:34)
at net.app.proxy.BlogProxy.flush(BlogProxy.java:52)
at net.app.speakup.SpeakUpFilter.doFilter(SpeakUpFilter.java:34)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.sql.SQLException: Connections could not be acquired from the underlying database!
at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:104)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:236)
at com.mchange.v2.c3p0.PoolBackedDataSource.getConnection(PoolBackedDataSource.java:94)
at org.hibernate.connection.C3P0ConnectionProvider.getConnection(C3P0ConnectionProvider.java:35)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:315)
... 26 more
Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.
at com.mchange.v2.resourcepool.BasicResourcePool.awaitAcquire(BasicResourcePool.java:970)
at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:208)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:232)
... 29 more
Name and version of the database you are using:
MySQL 4.1 and PostgreSQL 8.0