"
dbcp配置如下:
driverClassName=com.mysql.jdbc.Driver
url=jdbc:mysql://localhost:3306/t_xx?autoReconnect=true&useUnicode=true&characterEncoding=utf8
username=root
password=123456
initialSize=2
maxActive=10
maxIdle=2
minIdle=1
maxWait=30000
removeAbandoned=true
removeAbandonedTimeout=180
但是按照这个配置部署项目时,报以下错误:
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was40925 milliseconds ago.The last packet sent successfully to the server was 40925 milliseconds ago, which is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
请问这个是配置方面的问题吗?如果是,应该如何配置呢?请指导哈...谢谢!
注意连接池里连接的空闲时间应该小于 MySQL 配置里的 wait_timeout 的值
######maxWait=30000太大了?
######我试试看,谢谢了...
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。