• No operations allowed after statement closed.


    1、错误描述

    2017-04-07 15:02:12,499 [pool-1-thread-1] ERROR [com.alibaba.druid.pool.DruidDataSource] - discard connection
      com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after statement closed.
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    	at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)
    	at com.mysql.jdbc.Util.getInstance(Util.java:360)
    	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
    	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:935)
    	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:924)
    	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:870)
    	at com.mysql.jdbc.StatementImpl.checkClosed(StatementImpl.java:445)
    	at com.mysql.jdbc.PreparedStatement.clearParameters(PreparedStatement.java:1022)
    	at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_clearParameters(FilterChainImpl.java:2903)
    	at com.alibaba.druid.filter.FilterAdapter.preparedStatement_clearParameters(FilterAdapter.java:1053)
    	at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_clearParameters(FilterChainImpl.java:2900)
    	at com.alibaba.druid.proxy.jdbc.PreparedStatementProxyImpl.clearParameters(PreparedStatementProxyImpl.java:102)
    	at com.alibaba.druid.pool.DruidPooledConnection.closePoolableStatement(DruidPooledConnection.java:150)
    	at com.alibaba.druid.pool.DruidPooledPreparedStatement.close(DruidPooledPreparedStatement.java:201)
    	at org.springframework.jdbc.support.JdbcUtils.closeStatement(JdbcUtils.java:87)
    	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:656)
    	at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:909)
    	at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:970)
    	at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:980)
    	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
    	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:708)
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
    	at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98)
    	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262)
    	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95)
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:644)
    	at sun.reflect.GeneratedMethodAccessor51.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:65)
    	at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
    	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
    	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    	at java.lang.Thread.run(Thread.java:745)
    
    

    2、错误原因


    3、解决办法

  • 相关阅读:
    Python3 实现一个简单的TCP 客户端
    Mac 下 安装 和 使用 Go 框架 Beego
    Go 操作文件及文件夹 os.Mkdir及os.MkdirAll两者的区别
    Go gin 之 Air 实现实时加载
    Mac os 配置常用alias
    Mac 下 MAMP配置虚拟主机
    Thinkphp5 项目部署至linux服务器报403错误
    Linux 安装最新版 node.js 之坑
    Mac item2如何使用rz sz 上传下载命令
    Mac 使用 iTerm2 快捷登录远程服务器
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13313899.html
Copyright © 2020-2023  润新知