快上网专注成都网站设计 成都网站制作 成都网站建设
成都网站建设公司服务热线:028-86922220

网站建设知识

十年网站开发经验 + 多家企业客户 + 靠谱的建站团队

量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决

DruidException:Connection.clearWarnings

报错信息:

创新互联建站自2013年创立以来,是专业互联网技术服务公司,拥有项目网站设计、网站建设网站策划,项目实施与项目整合能力。我们以让每一个梦想脱颖而出为使命,1280元泊头做网站,已为上家服务,为泊头各地企业和个人服务,联系电话:13518219792

ERROR c.alibaba.druid.pool.DruidDataSource - recyle error
java.sql.SQLException: Connection.clearWarnings cannot be called on a closed connection
at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.getSqlException(ExceptionMapper.java:271)
at org.mariadb.jdbc.MariaDbConnection.clearWarnings(MariaDbConnection.java:1070)
at com.alibaba.druid.filter.FilterChainImpl.connection_clearWarnings(FilterChainImpl.java:165)
at com.alibaba.druid.filter.FilterAdapter.connection_clearWarnings(FilterAdapter.java:771)
at com.alibaba.druid.filter.FilterChainImpl.connection_clearWarnings(FilterChainImpl.java:161)
at com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl.clearWarnings(ConnectionProxyImpl.java:108)
at com.alibaba.druid.pool.DruidConnectionHolder.reset(DruidConnectionHolder.java:295)
at com.alibaba.druid.pool.DruidDataSource.recycle(DruidDataSource.java:1662)

问题:

spring.datasource.druid.initial-size=1
spring.datasource.druid.min-idle=1
spring.datasource.druid.max-active=20
spring.datasource.druid.test-on-borrow=true
spring.datasource.druid.stat-view-servlet.allow=true
spring.datasource.druid.max-wait=60000

解决方案:

spring.datasource.druid.initial-size=1
spring.datasource.druid.min-idle=1
spring.datasource.druid.max-active=20
spring.datasource.druid.test-on-borrow=false
spring.datasource.druid.test-while-idle=true
spring.datasource.druid.validation-query=select 'X'

因为少配置了这个所以拿到了连接不检查,哭晕.........
怪自己太年轻......

spring.datasource.druid.validation-query=select 'X'

当前题目:DruidException:Connection.clearWarnings
转载源于:http://6mz.cn/article/gjiegj.html

其他资讯