错误 - java.sql.SQLException:无法从基础数据库获取连接! (..) 信息:Sql查询中的错误。 CREATE TABLE IF NOT EXISTS SUITEREPORTS(ID BIGINT IDENTITY,SUITEREPORTID VARCHAR(255),SUITENAME VARCHAR(2000),SUITEPATH VARCHAR(2000),STARTTIME时间戳,ENDTIME时间戳,STATUS VARCHAR(255),TOTALCOUNT INT,PASSEDCOUNT INT,FAILEDCOUNT INT, TIMETAKEN INT,BROWSERTYPE VARCHAR(255))
在某一刻(可能因为自由空间丢失)sahi建立在jenkins停止工作。当我打开日志数据库时,我收到了文本 - 无法从底层数据库中获取Connections!
在控制台日志中:
[java] Nov 21, 2017 1:37:22 PM in.co.sahi.datastore.SahiDB createTables
[java] INFO: version=2017-05-09 20:45:45
[java] Nov 21, 2017 1:37:22 PM in.co.sahi.datastore.SahiDB createTables
[java] INFO: Updating tables structures.
[java] java.sql.SQLException: Connections could not be acquired from the underlying database!
[java] at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:118)
[java] at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:690)
[java] at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:140)
[java] at net.sf.sahi.plugin.PooledDBClient.getConnection(PooledDBClient.java:31)
[java] at net.sf.sahi.plugin.DBClient.execute(DBClient.java:66)
[java] at in.co.sahi.datastore.SahiDB.executeSQL(SahiDB.java:162)
[java] at in.co.sahi.datastore.SahiDB.createTables(SahiDB.java:98)
[java] at in.co.sahi.datastore.SahiDB.<clinit>(SahiDB.java:32)
[java] at net.sf.sahi.f.run(Unknown Source)
[java] at java.lang.Thread.run(Thread.java:748)
[java] Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.
[java] at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1418)
[java] at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:606)
[java] at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:526)
[java] at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutAndMarkConnectionInUse(C3P0PooledConnectionPool.java:756)
[java] at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:683)
[java] ... 8 more
[java] Nov 21, 2017 1:37:54 PM in.co.sahi.datastore.SahiDB createTables
[java] INFO: -----------------------------------------------
[java] Nov 21, 2017 1:37:54 PM in.co.sahi.datastore.SahiDB createTables
[java] INFO: Error in Sql Query.
[java] CREATE TABLE IF NOT EXISTS SUITEREPORTS (ID BIGINT IDENTITY, SUITEREPORTID VARCHAR(255), SUITENAME VARCHAR(2000), SUITEPATH VARCHAR(2000), STARTTIME TIMESTAMP, ENDTIME TIMESTAMP, STATUS VARCHAR(255), TOTALCOUNT INT, PASSEDCOUNT INT, FAILEDCOUNT INT, TIMETAKEN INT, BROWSERTYPE VARCHAR(255))
[java] exception: java.sql.SQLException: Connections could not be acquired from the underlying database!
[java] at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:118)
[java] at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:690)
[java] at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:140)
[java] at net.sf.sahi.plugin.PooledDBClient.getConnection(PooledDBClient.java:31)
[java] at net.sf.sahi.plugin.DBClient.execute(DBClient.java:66)
[java] at in.co.sahi.datastore.SahiDB.executeSQL(SahiDB.java:162)
[java] at in.co.sahi.datastore.SahiDB.createTables(SahiDB.java:98)
[java] at in.co.sahi.datastore.SahiDB.<clinit>(SahiDB.java:32)
[java] at net.sf.sahi.f.run(Unknown Source)
[java] at java.lang.Thread.run(Thread.java:748)
[java] Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.
[java] at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1418)
[java] at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:606)
[java] at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:526)
[java] at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutAndMarkConnectionInUse(C3P0PooledConnectionPool.java:756)
[java] at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:683)
[java] ... 8 more
[java]
[java] Nov 21, 2017 1:37:54 PM in.co.sahi.datastore.SahiDB createTables
[java] INFO: -----------------------------------------------
[java] java.sql.SQLException: Connections could not be acquired from the underlying database!
[java] at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:118)
[java] at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:690)
[java] at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:140)
[java] at net.sf.sahi.plugin.PooledDBClient.getConnection(PooledDBClient.java:31)
[java] at net.sf.sahi.plugin.DBClient.execute(DBClient.java:66)
[java] at in.co.sahi.datastore.SahiDB.executeSQL(SahiDB.java:162)
[java] at net.sf.sahi.test.SuiteSummary.init(SuiteSummary.java:104)
[java] at in.co.sahi.distributed.DSuiteRunner.execute(DSuiteRunner.java:72)
[java] at in.co.sahi.command.Master$1.run(Master.java:117)
[java] at java.lang.Thread.run(Thread.java:748)
[java] Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.
[java] at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1418)
[java] at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:606)
[java] at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:526)
[java] at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutAndMarkConnectionInUse(C3P0PooledConnectionPool.java:756)
[java] at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:683)
[java] ... 8 more
哪里有问题?我该怎么办?
答案 0 :(得分:0)
请告诉我您使用Sahi的数据库。
确保在Sahi属性中为数据库添加了正确的JDBC URL。