1、com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@6ff9129c

com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@6ff9129c -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed ). Last acquisition attempt exception:
java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:)
    at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:)
    at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:)
    at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:)
    at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:)
    at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:)
    at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:)
    at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:)
    at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:)
    at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:)
    at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:)
    at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:)
    at com.mchange.v2.resourcepool.BasicResourcePool.access$(BasicResourcePool.java:)
    at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:)
    at com.mchange.v2.)
Caused by: com.mysql.cj.core.exceptions.InvalidConnectionAttributeException: The server time zone value '�й���׼ʱ��' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
    at sun.reflect.GeneratedConstructorAccessor8.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:)
    at com.mysql.cj.core.exceptions.ExceptionFactory.createException(ExceptionFactory.java:)
    at com.mysql.cj.core.exceptions.ExceptionFactory.createException(ExceptionFactory.java:)
    at com.mysql.cj.jdbc.util.TimeUtil.getCanonicalTimezone(TimeUtil.java:)
    at com.mysql.cj.mysqla.MysqlaSession.configureTimezone(MysqlaSession.java:)
    at com.mysql.cj.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:)
    at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:)
    at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:)
    ...  more

九月 ,  :: 下午 com.mchange.v2.resourcepool.BasicResourcePool forceKillAcquires
警告: Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicResourcePool@192d43ce is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests.
九月 ,  :: 下午 com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask run
警告: com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@2413b53c -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed ). Last acquisition attempt exception:
java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:)
    at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:)
    at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:)
    at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:)
    at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:)
    at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:)
    at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:)
    at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:)
    at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:)
    at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:)
    at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:)
    at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:)
    at com.mchange.v2.resourcepool.BasicResourcePool.access$(BasicResourcePool.java:)
    at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:)
    at com.mchange.v2.)
Caused by: com.mysql.cj.core.exceptions.InvalidConnectionAttributeException: The server time zone value '�й���׼ʱ��' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
    at sun.reflect.GeneratedConstructorAccessor8.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:)

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

    at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:)
    at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:)
    at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:)
    at springDataTest.SpringDataTest.testDataSource(SpringDataTest.java:)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:)
    at java.lang.reflect.Method.invoke(Method.java:)
    at org.testng.)
    at org.testng.)
    at org.testng.)
    at org.testng.)
    at org.testng.)
    at org.testng.)
    at org.testng.TestRunner.privateRun(TestRunner.java:)
    at org.testng.TestRunner.run(TestRunner.java:)
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:)
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:)
    at org.testng.SuiteRunner.run(SuiteRunner.java:)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:)
    at org.testng.TestNG.run(TestNG.java:)
    at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:)
    at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:)
    at java.lang.reflect.Method.invoke(Method.java:)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:)
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:)
    at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:)
    at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:)
    at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutAndMarkConnectionInUse(C3P0PooledConnectionPool.java:)
    at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:)
    ...  more

    at com.mysql.cj.core.exceptions.ExceptionFactory.createException(ExceptionFactory.java:)
    at com.mysql.cj.core.exceptions.ExceptionFactory.createException(ExceptionFactory.java:)
    at com.mysql.cj.jdbc.util.TimeUtil.getCanonicalTimezone(TimeUtil.java:)
    at com.mysql.cj.mysqla.MysqlaSession.configureTimezone(MysqlaSession.java:)
    at com.mysql.cj.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:)
    at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:)
    at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:)
    ...  more

解决方案:

connecturl添加&serverTimezone=UTC

完整的db.properties 如下

jdbc.user=root
jdbc.password=root
#jdbc.driverClass=com.mysql.cj.jdbc.Driver
jdbc.driverClass=com.mysql.jdbc.Driver
jdbc.jdbcUrl=jdbc:mysql://localhost:3306/gss?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=UTC

2、org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [javax.sql.DataSource] is defined

org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [javax.sql.DataSource] is defined

    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:)
    at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:)
    at springDataTest.SpringDataTest.testDataSource(SpringDataTest.java:)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:)
    at java.lang.reflect.Method.invoke(Method.java:)
    at org.testng.)
    at org.testng.)
    at org.testng.)
    at org.testng.)
    at org.testng.)
    at org.testng.)
    at org.testng.TestRunner.privateRun(TestRunner.java:)
    at org.testng.TestRunner.run(TestRunner.java:)
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:)
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:)
    at org.testng.SuiteRunner.run(SuiteRunner.java:)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:)
    at org.testng.TestNG.run(TestNG.java:)
    at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:)
    at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:)
    at java.lang.reflect.Method.invoke(Method.java:)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:)

解决方案:


将<bean id="datasource" class="com.mchange.v2.c3p0.jboss.C3P0PooledDataSource">换成<bean id="datasource" class="com.mchange.v2.c3p0.ComboPooledDataSource">

 

连接mysql提示com.mchange.v2.resourcepool.BasicResourcePool的更多相关文章

  1. Caused by: com.mchange.v2.resourcepool.TimeoutException: A client timed out while waiting to acquire a resource from com.mchange.v2.resourcepool.BasicResourcePool@1483de4 -- timeout at awaitAvailable(

    Caused by: com.mchange.v2.resourcepool.TimeoutException: A client timed out while waiting to acquire ...

  2. 项目跑起来之后,一会儿后台就会报错Illegal access: this web application instance has been stopped already. Could not load [com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask]. The following stack trace

    一月 24, 2016 6:42:54 下午 org.apache.catalina.loader.WebappClassLoaderBase checkStateForResourceLoading ...

  3. c3p0 空指针异常 com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.

    com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@11d9f05 -- Acquisition Attempt Failed!!! C ...

  4. 关于使用C3P0程序报错Having failed to acquire a resource, com.mchange.v2.resourcepool的问题

    由于是新手的问题,C3P0的使用时严格跟着视频来的,但是问题却来的很突然 在导入了三个包以及创建了路径以后 进行测试 class JdbcutilsTest { @Test void TestGetC ...

  5. 连接Mysql提示Can’t connect to local MySQL server through socket的解决方法

    mysql,mysqldump,Mysqladmin,php连接mysql服务常会提示下面错误: ERROR 2002 (HY000): Can't connect to local MySQL se ...

  6. powerdesigner 连接mysql提示“connection test failed”

    powerdesigner  连接mysql提示“connection test failed”,该如何解决: 1.把64位的jdk换成32位的jdk(VM只支持32的jre) 2.系统变量:  CL ...

  7. win10连接mysql提示:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

    win10中cmd连接mysql提示:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YE ...

  8. mac 连接mysql提示 Warning: mysqli::real_connect(): (HY000/2002): No such file or directory

    mac 连接mysql的时候提示 Warning: mysqli::real_connect(): (HY000/2002): No such file or directory [说明1]MAC下M ...

  9. dbexpress连接mysql提示Operation not allowed on a unidirectional dataset

    最近刚接触delphi,在了解到dbExpress连接mysql的时候,出现了一些问题,特记录下 我遇到的问题有两个 1. TDBGrid --DataSet=TDataSource1 TDataSo ...

随机推荐

  1. 15.2 THE USE OF A LARGE REGISTER FILE

    COMPUTER ORGANIZATION AND ARCHITECTURE DESIGNING FOR PERFORMANCE NINTH EDITION

  2. Task示例,多线程

    class Program { static void Main(string[] args) { Run(); } public static async void Run() { var task ...

  3. 【转】NGUI研究院之自适应屏幕(十)

    http://www.xuanyusong.com/archives/2536 现在用unity做项目 90%都是用NGUI,并且我个人觉得NGUI应该算是比较成熟的UI插件,虽然他也存在很多问题,但 ...

  4. java调用 webservices接口实现天气预报

    最近要用到web services,而这两天也比较有空,就弄了一个获取天气预报的Util.以前以为这有多难,因为数据来源是个困难.现在用web services的技术,发现下面这个是相当不错的.下面就 ...

  5. rabbitMQ集群部署以及集群之间同步

    MQ集群部署 期待的部署架构 其中,一个机房有两台机器部署MQ,并组成集群,有一个机房的MQ集群作为中心集群,其他机房的MQ集群将消息同步到中心MQ集群中. 安装erlang,略.. 安装rabbit ...

  6. change和onchange触发为什么不立马生效?

    change和onchange触发了,为什么不立马生效?那是因为他们本身不是当文本改变就立马触发的事件,而是当文本改变了,blur离开了表单才触发. 如果要加上触发请结合keyup,keydown,o ...

  7. 去除行内(inline/inline-block)元素之间的间距

    先展示一下,行内元素之间存在间距,实例代码如下: <style> div { color: #fff; padding: 25px 50px; } .inline-f00 { displa ...

  8. tcp_tw_recycle 的问题, 使用某一个wifi,APP老是连接不上网络

    ss -tan 反映出来的情况就是在服务器上抓包,发现有SYN包,但服务器就是不回ACK包,因为SYN包已经被丢弃了.为了验证这一结果,可以执行netstat -s | grep timestamp ...

  9. Java基础之扩展GUI——高亮元素、上下文菜单、移动旋转元素、自定义颜色(Sketcher 10)

    窗口应用程序. 本例在上一版的基础上实现了高亮元素.移动元素.上下文菜单.旋转元素.设置自定义颜色. 1.自定义常量包: // Defines application wide constants p ...

  10. c# signalr聊天室开源资料

    SignalR+LayIM源码: http://www.cnblogs.com/panzi/p/5742089.html 钉钉客户端源码: http://www.cnblogs.com/loveson ...