java.sql.SQLException: Connections could not be acquired from the underlying database!

Atlassian JIRA | Rafael Sperafico [Atlassian] | 5 months ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    h3. Summary * JDBC Datasource works during Bamboo installation but it does not work once the application is restarted. * Installing Bamboo with JDBC attempting on changing to Datasource does not work either. h3. Environment * Bamboo v5.13.0.1 h3. Steps to Reproduce *Installation using _Connect via a datasource_* # add the following configuration to {{<bamboo-install>/conf/server.xm}} {code:xml|title=<bamboo-install>/conf/server.xml} <Manager pathname=""/> <!-- DataSource with MSSQL --> <Resource name="jdbc/BambooDB" auth="Container" type="javax.sql.DataSource" username="bamuser" password="bampass" driverClassName="net.sourceforge.jtds.jdbc.Driver" url="jdbc:jtds:sqlserver://192.168.10.72:1433/bamboo" maxTotal="100" maxIdle="10" maxWaitMillis="30000" maxWait="-1" validationQuery="Select 1" /> {code} # install Bamboo v5.13.0.1 # select {{Connect via a datasource}} and add the following: {code} java:comp/env/jdbc/BambooDB {code} (i) Finish the installation process # *stop Bamboo* # *start Bamboo* *Installation using _Direct JDBC connection_* * install Bamboo * in *Database configuration* select {{Direct JDBC connection}} (i) fill in the requested and finish the installation # *stop Bamboo* # add the following configuration to {{<bamboo-install>/conf/server.xm}} {code:xml|title=<bamboo-install>/conf/server.xml} <Manager pathname=""/> <!-- DataSource with MSSQL --> <Resource name="jdbc/BambooDB" auth="Container" type="javax.sql.DataSource" username="bamuser" password="bampass" driverClassName="net.sourceforge.jtds.jdbc.Driver" url="jdbc:jtds:sqlserver://192.168.10.72:1433/bamboo" maxTotal="100" maxIdle="10" maxWaitMillis="30000" maxWait="-1" validationQuery="Select 1" /> {code} # remove all *hibernate* entries from "{{<bamboo-home>/bamboo.cfg.xml}}" and add the following instead: {code:xml|title=<bamboo-home>/bamboo.cfg.xml} <property name="hibernate.connection.datasource">java:comp/env/jdbc/BambooDB</property> <property name="hibernate.dialect">com.atlassian.bamboo.hibernate.SQLServerIntlDialect</property> <property name="hibernate.setup">true</property> {code} h3. Expected Results * in both scenarios *Installation using _Connect via a datasource_* and *Installation using _Direct JDBC connection_* Bamboo should be able to connect to the database on all {{<bamboo-install>/bin/start-bamboo.sh}} h3. Actual Results *Installation using _Connect via a datasource_* * The following can be seen in {{<bamboo-install>/logs/catalina.out}}: {code:title=<bamboo-install>/logs/catalina.out} 2016-09-15 15:58:05,055 ERROR [localhost-startStop-1] [AbstractBootstrapUpgradeTask] Error getting database connection java.sql.SQLException: Connections could not be acquired from the underlying database! at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:118) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:692) at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:140) at org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider.getConnection(C3P0ConnectionProvider.java:84) at com.atlassian.bamboo.upgrade.BootstrapTaskConnectionProvider.getConnection(BootstrapTaskConnectionProvider.java:59) at com.atlassian.bamboo.upgrade.AbstractBootstrapUpgradeTask.getDatabaseConnection(AbstractBootstrapUpgradeTask.java:49) at com.atlassian.bamboo.upgrade.AbstractBootstrapUpgradeTask.withDatabaseConnection(AbstractBootstrapUpgradeTask.java:74) at com.atlassian.bamboo.upgrade.tasks.validation.ThereIsSingleRowInHibernateUniqueKeyTable.doUpgrade(ThereIsSingleRowInHibernateUniqueKeyTable.java:34) at com.atlassian.bamboo.upgrade.AbstractUpgradeManager.runUpgradeTask(AbstractUpgradeManager.java:206) at com.atlassian.bamboo.upgrade.BootstrapUpgradeManagerImpl.runValidationTests(BootstrapUpgradeManagerImpl.java:84) at com.atlassian.bamboo.setup.DefaultBootstrapManager.performPersistenceUpgrade(DefaultBootstrapManager.java:345) at com.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager.init(DefaultAtlassianBootstrapManager.java:77) at com.atlassian.bamboo.setup.BootstrapLoaderListener.contextInitialized(BootstrapLoaderListener.java:118) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4842) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5303) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1407) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1397) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) 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.awaitAvailable(BasicResourcePool.java:1469) at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:644) at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:554) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutAndMarkConnectionInUse(C3P0PooledConnectionPool.java:758) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:685) ... 20 more Caused by: java.lang.NullPointerException at oracle.jdbc.driver.OracleDriver.acceptsURL(OracleDriver.java:638) at java.sql.DriverManager.getDriver(DriverManager.java:299) at com.mchange.v2.c3p0.DriverManagerDataSource.driver(DriverManagerDataSource.java:285) at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:161) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:161) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:147) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:202) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1138) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1125) at com.mchange.v2.resourcepool.BasicResourcePool.access$700(BasicResourcePool.java:44) at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1870) at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696) {code} *Installation using _Direct JDBC connection_* * The following can be seen in {{<bamboo-install>/logs/catalina.out}}: {code:title=<bamboo-install>/logs/catalina.out} 2016-09-15 15:57:34,760 WARN [localhost-startStop-1] [C3P0ConnectionProvider] HHH000148: No JDBC Driver class was specified by property hibernate.connection.driver_class ... 2016-09-15 15:58:05,055 ERROR [localhost-startStop-1] [AbstractBootstrapUpgradeTask] Error getting database connection java.sql.SQLException: Connections could not be acquired from the underlying database! at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:118) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:692) at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:140) at org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider.getConnection(C3P0ConnectionProvider.java:84) at com.atlassian.bamboo.upgrade.BootstrapTaskConnectionProvider.getConnection(BootstrapTaskConnectionProvider.java:59) at com.atlassian.bamboo.upgrade.AbstractBootstrapUpgradeTask.getDatabaseConnection(AbstractBootstrapUpgradeTask.java:49) at com.atlassian.bamboo.upgrade.AbstractBootstrapUpgradeTask.withDatabaseConnection(AbstractBootstrapUpgradeTask.java:74) at com.atlassian.bamboo.upgrade.tasks.validation.ThereIsSingleRowInHibernateUniqueKeyTable.doUpgrade(ThereIsSingleRowInHibernateUniqueKeyTable.java:34) at com.atlassian.bamboo.upgrade.AbstractUpgradeManager.runUpgradeTask(AbstractUpgradeManager.java:206) at com.atlassian.bamboo.upgrade.BootstrapUpgradeManagerImpl.runValidationTests(BootstrapUpgradeManagerImpl.java:84) at com.atlassian.bamboo.setup.DefaultBootstrapManager.performPersistenceUpgrade(DefaultBootstrapManager.java:345) at com.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager.init(DefaultAtlassianBootstrapManager.java:77) at com.atlassian.bamboo.setup.BootstrapLoaderListener.contextInitialized(BootstrapLoaderListener.java:118) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4842) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5303) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1407) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1397) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) 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.awaitAvailable(BasicResourcePool.java:1469) at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:644) at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:554) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutAndMarkConnectionInUse(C3P0PooledConnectionPool.java:758) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:685) ... 20 more Caused by: java.lang.NullPointerException at oracle.jdbc.driver.OracleDriver.acceptsURL(OracleDriver.java:638) at java.sql.DriverManager.getDriver(DriverManager.java:299) at com.mchange.v2.c3p0.DriverManagerDataSource.driver(DriverManagerDataSource.java:285) at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:161) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:161) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:147) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:202) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1138) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1125) at com.mchange.v2.resourcepool.BasicResourcePool.access$700(BasicResourcePool.java:44) at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1870) at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696) {code} h3. Workaround * No workaround available

    Atlassian JIRA | 5 months ago | Rafael Sperafico [Atlassian]
    java.sql.SQLException: Connections could not be acquired from the underlying database!
  2. 0

    Former home of Roller Weblogger / Mailing Lists

    sourceforge.net | 1 year ago
    net.sf.hibernate.JDBCException: Cannot open connection: Cannot create JDBC driver of class '' for connect URL 'null'
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

    1 unregistered visitors

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at oracle.jdbc.driver.OracleDriver.acceptsURL()
    2. Oracle jdbc
      OracleDriver.acceptsURL
      1. oracle.jdbc.driver.OracleDriver.acceptsURL(OracleDriver.java:638)
      1 frame
    3. Java RT
      DriverManager.getDriver
      1. java.sql.DriverManager.getDriver(DriverManager.java:299)
      1 frame
    4. c3p0:JDBC DataSources/Resource Pools
      ThreadPoolAsynchronousRunner$PoolThread.run
      1. com.mchange.v2.c3p0.DriverManagerDataSource.driver(DriverManagerDataSource.java:285)
      2. com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:161)
      3. com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:161)
      4. com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:147)
      5. com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:202)
      6. com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1138)
      7. com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1125)
      8. com.mchange.v2.resourcepool.BasicResourcePool.access$700(BasicResourcePool.java:44)
      9. com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1870)
      10. com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696)
      10 frames