증상
org.springframework.transaction.CannotCreateTransactionException: Could not create Hibernate transaction; nested exception is net.sf.hibernate.exception.GenericJDBCException: Cannot open connection net.sf.hibernate.exception.GenericJDBCException: Cannot open connection at net.sf.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:80) at net.sf.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:69) at net.sf.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29) .... .... Caused by: java.sql.SQLException: An SQLException was provoked by the following failure: com.mchange.v2.resourcepool.ResourcePoolException: A ResourcePool could not acquire a resource from its primary factory or source. at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:68) at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:57) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:213) at com.mchange.v2.c3p0.PoolBackedDataSource.getConnection(PoolBackedDataSource.java:64) at net.sf.hibernate.connection.C3P0ConnectionProvider.getConnection(C3P0ConnectionProvider.java:33) at net.sf.hibernate.impl.BatcherImpl.openConnection(BatcherImpl.java:292) ... 63 more Caused by: com.mchange.v2.resourcepool.ResourcePoolException: A ResourcePool could not acquire a resource from its primary factory or source. at com.mchange.v2.resourcepool.BasicResourcePool.awaitAcquire(BasicResourcePool.java:870) at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:201) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:209) ... 66 more |
원인
This error is stating that it cannot get a connection to the database.
Possibly causes are:
1) The database is down, possibly due to being overwhelmed.
2) The server confluence is on, cannot reach the server the database is on
3) Your username and password that you used for your database in confluence_home/confluence.cfg.xml
is incorrect
4) There are not enough JDBC connections available during the upgrade process
해결 방법
1) Check with your DBA that your database is up and running. If the problem has happened after a period of Confluence usage, check to make sure the database indices are installed correctly. See Improving Database Performance for details.
2) Talk to your network administrator to find out why your confluence server cannot establish a connection to the database
3) Check with your DBA that your user/pass that you are using for your database is correct and hasn't been changed
4) Go to the confluence.cfg.xml file in the Confluence Home Directory. There is an entry in this file that will look like this:
<property name="hibernate.c3p0.max_size">30</property>
Set the max_size connections to a greater number then is set in the file currently. This particular problem was encountered during an upgrade. Please refer to this knowledge base article:
Confluence Slows and Times out During Periods of High Load due to DB Connection Pool