Spring+Mybatis整合出现Cannot create PoolableConnectionFactory错误

本文介绍了在Spring+Mybatis整合过程中遇到的`Cannot create PoolableConnectionFactory`错误,问题源于Mysql连接驱动版本不匹配。通过升级驱动版本并修改连接URL中的`serverTimezone`为`UTC`,成功解决了JUNIT测试的异常。同时解释了`serverTimezone`参数的意义,指出在使用8.0.11版驱动时,驱动类已更改为`com.mysql.cj.jdbc.Driver`,连接URL格式也需要相应调整。
摘要由CSDN通过智能技术生成

Spring+Mybatis遇见bug org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory

控制台输出

16:55:16,032  INFO ClassPathXmlApplicationContext:581 - Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@6979e8cb: startup date [Wed Oct 16 16:55:16 CST 2019]; root of context hierarchy
16:55:16,106  INFO XmlBeanDefinitionReader:317 - Loading XML bean definitions from class path resource [applicationContext.xml]
16:55:16,580  INFO PropertySourcesPlaceholderConfigurer:172 - Loading properties file from class path resource [jdbc.properties]

JUNIT报错异常


org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is org.apache.commons.dbcp.S
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值