今天线上系统碰到个怪问题DBCP数据连接异常,java.sql.SQLException: Already closed.

java.sql.SQLException: Already closed.

at org.apache.commons.dbcp.PoolableConnection.close(PoolableConnection.java:84) ~[commons-dbcp-1.2.2.jar:1.2.2]

at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.close(PoolingDataSource.java:181) ~[commons-dbcp-1.2.2.jar:1.2.2]

at sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source) ~[na:na]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_45]

at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_45]

at org.tinygroup.dynamicdatasource.DynamicDataSource$ConnectionInvocationHandler.invoke(DynamicDataSource.java:227) ~[org.tinygroup.dynamicdatasource-2.0.0.jar:na]

at com.sun.proxy.$Proxy21.close(Unknown Source) ~[na:na]

at org.springframework.jdbc.datasource.DataSourceUtils.doReleaseConnection(DataSourceUtils.java:313) ~[spring-jdbc-2.5.6.jar:2.5.6]

at org.springframework.jdbc.datasource.DataSourceUtils.releaseConnection(DataSourceUtils.java:274) ~[spring-jdbc-2.5.6.jar:2.5.6]

at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:237) [spring-jdbc-2.5.6.jar:2.5.6]

at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:374) [spring-tx-2.5.6.jar:2.5.6]

at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:263) [spring-tx-2.5.6.jar:2.5.6]

at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:101) [spring-tx-2.5.6.jar:2.5.6]

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) [spring-aop-2.5.6.jar:2.5.6]

at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89) [spring-aop-2.5.6.jar:2.5.6]

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) [spring-aop-2.5.6.jar:2.5.6]

at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) [spring-aop-2.5.6.jar:2.5.6]

at com.sun.proxy.$Proxy16.addCreditSerial(Unknown Source) [na:na]

at com.hsyr.cloud.p2p.loan.svr.credit.PLCreditService.addCreditSerialForUpdate(PLCreditService.java:323) [com.hsyr.cloud.p2p.loan.service-1.0.0-SNAPSHOT.jar:na]

at com.hsyr.cloud.p2p.loan.svr.credit.PLCreditService.updateCreditRemain(PLCreditService.java:291) [com.hsyr.cloud.p2p.loan.service-1.0.0-SNAPSHOT.jar:na]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.6.0_45]

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ~[na:1.6.0_45]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_45]

at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_45]

at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:216) [org-exp-redis-1.0.0.jar:na]

at org.tinygroup.service.ServiceProxy.execute(ServiceProxy.java:150) [org.tinygroup.service-2.0.0.jar:na]

at org.tinygroup.service.impl.ServiceProviderImpl.execute(ServiceProviderImpl.java:85) [org.tinygroup.service-2.0.0.jar:na]

at org.tinygroup.serviceprocessor.ServiceEventProcessorImpl.process(ServiceEventProcessorImpl.java:47) [org.tinygroup.serviceprocessor-2.0.0.jar:na]

at org.tinygroup.cepcoreimpl.CEPCoreImpl.deal(CEPCoreImpl.java:279) [org.tinygroup.cepcoreimpl-2.0.0.jar:na]

at org.tinygroup.cepcoreimpl.CEPCoreImpl.process(CEPCoreImpl.java:224) [org.tinygroup.cepcoreimpl-2.0.0.jar:na]

at com.hsyr.cloud.p2p.loan.biz.util.PLProcessorServiceAction.callService(PLProcessorServiceAction.java:83) [com.hsyr.cloud.p2p.loan.biz-1.0.0-SNAPSHOT.jar:na]

at com.hsyr.cloud.p2p.loan.biz.util.PLProcessorServiceAction.retryInnerRequest(PLProcessorServiceAction.java:404) [com.hsyr.cloud.p2p.loan.biz-1.0.0-SNAPSHOT.jar:na]

at com.hsyr.cloud.p2p.loan.biz.util.PLProcessorServiceAction.performGetResult(PLProcessorServiceAction.java:393) [com.hsyr.cloud.p2p.loan.biz-1.0.0-SNAPSHOT.jar:na]

at com.hsyr.cloud.p2p.loan.biz.util.PLProcessorServiceAction.reallyProcess(PLProcessorServiceAction.java:185) [com.hsyr.cloud.p2p.loan.biz-1.0.0-SNAPSHOT.jar:na]

at com.hsyr.cloud.p2p.loan.ctl.PLTaskServiceAction.processTaskServiceAction(PLTaskServiceAction.java:57) [com.hsyr.cloud.p2p.loan.ctl-1.0.0-SNAPSHOT.jar:na]

at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source) ~[na:na]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_45]

at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_45]

at org.tinygroup.commons.tools.ReflectionUtils.invokeMethod(ReflectionUtils.java:190) [org.tinygroup.commons-2.0.0.jar:na]

at org.tinygroup.weblayer.mvc.HandlerExecutionChain.execute(HandlerExecutionChain.java:133) [org.tinygroup.weblayer-2.0.0.jar:na]

at org.tinygroup.weblayer.mvc.impl.MappingModelExecuteImpl.execute(MappingModelExecuteImpl.java:40) [org.tinygroup.weblayer-2.0.0.jar:na]

at org.tinygroup.weblayer.tinyprocessor.MvcTinyProcessor.reallyProcess(MvcTinyProcessor.java:74) [org.tinygroup.weblayer-2.0.0.jar:na]

at org.tinygroup.weblayer.AbstractTinyProcessor.process(AbstractTinyProcessor.java:68) [org.tinygroup.weblayer-2.0.0.jar:na]

at org.tinygroup.weblayer.impl.TinyProcessorManagerImpl.execute(TinyProcessorManagerImpl.java:68) [org.tinygroup.weblayer-2.0.0.jar:na]

at org.tinygroup.weblayer.TinyFilterHandler.tinyFilterProcessor(TinyFilterHandler.java:107) [org.tinygroup.weblayer-2.0.0.jar:na]

at org.tinygroup.weblayer.impl.TinyFilterChain.doFilter(TinyFilterChain.java:62) [org.tinygroup.weblayer-2.0.0.jar:na]

at org.tinygroup.weblayer.filter.gzip.GZIPFilter.doFilter(GZIPFilter.java:75) [org.tinygroup.weblayer-2.0.0.jar:na]

at org.tinygroup.weblayer.impl.TinyFilterChain.doFilter(TinyFilterChain.java:59) [org.tinygroup.weblayer-2.0.0.jar:na]

at org.tinygroup.weblayer.impl.TinyFilterWrapper.filterWrapper(TinyFilterWrapper.java:79) [org.tinygroup.weblayer-2.0.0.jar:na]

at org.tinygroup.weblayer.TinyHttpFilter.doFilter(TinyHttpFilter.java:142) [org.tinygroup.weblayer-2.0.0.jar:na]

at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1288) [jetty-servlet-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:443) [jetty-servlet-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137) [jetty-server-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:532) [jetty-security-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227) [jetty-server-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1044) [jetty-server-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:372) [jetty-servlet-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:189) [jetty-server-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:978) [jetty-server-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135) [jetty-server-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255) [jetty-server-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154) [jetty-server-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116) [jetty-server-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.server.Server.handle(Server.java:369) [jetty-server-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:486) [jetty-server-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:933) [jetty-server-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:995) [jetty-server-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644) [jetty-http-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235) [jetty-http-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82) [jetty-server-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667) [jetty-io-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52) [jetty-io-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608) [jetty-util-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543) [jetty-util-7.6.17.v20150415.jar:7.6.17.v20150415]

at java.lang.Thread.run(Thread.java:662) [na:1.6.0_45]

08:55:18.279 [qtp116331389-16] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating shared instance of singleton bean ‘exceptionHandlerManager‘

08:55:18.279 [qtp116331389-16] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating instance of bean ‘exceptionHandlerManager‘

08:55:18.279 [qtp116331389-16] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean ‘org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0‘

08:55:18.279 [qtp116331389-16] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Eagerly caching bean ‘exceptionHandlerManager‘ to allow for resolving potential circular references

08:55:18.282 [qtp116331389-16] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean ‘org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0‘

08:55:18.282 [qtp116331389-16] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean ‘org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0‘

08:55:18.283 [qtp116331389-16] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Finished creating instance of bean ‘exceptionHandlerManager‘

08:55:18.284 [qtp116331389-16] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean ‘exceptionHandlerManager‘

08:55:18.284 [qtp116331389-16] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean ‘exceptionHandlerManager‘

08:55:18.284 [qtp116331389-16] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean ‘exceptionHandlerManager‘

08:55:18.289 [qtp116331389-16] ERROR c.h.c.p.l.b.u.PLProcessorServiceAction - null

org.tinygroup.service.exception.ServiceRunException: null

at org.tinygroup.service.ServiceProxy.execute(ServiceProxy.java:166) ~[org.tinygroup.service-2.0.0.jar:na]

at org.tinygroup.service.impl.ServiceProviderImpl.execute(ServiceProviderImpl.java:85) ~[org.tinygroup.service-2.0.0.jar:na]

at org.tinygroup.serviceprocessor.ServiceEventProcessorImpl.process(ServiceEventProcessorImpl.java:47) ~[org.tinygroup.serviceprocessor-2.0.0.jar:na]

at org.tinygroup.cepcoreimpl.CEPCoreImpl.deal(CEPCoreImpl.java:279) ~[org.tinygroup.cepcoreimpl-2.0.0.jar:na]

at org.tinygroup.cepcoreimpl.CEPCoreImpl.process(CEPCoreImpl.java:224) ~[org.tinygroup.cepcoreimpl-2.0.0.jar:na]

at com.hsyr.cloud.p2p.loan.biz.util.PLProcessorServiceAction.callService(PLProcessorServiceAction.java:83) ~[com.hsyr.cloud.p2p.loan.biz-1.0.0-SNAPSHOT.jar:na]

at com.hsyr.cloud.p2p.loan.biz.util.PLProcessorServiceAction.retryInnerRequest(PLProcessorServiceAction.java:404) ~[com.hsyr.cloud.p2p.loan.biz-1.0.0-SNAPSHOT.jar:na]

at com.hsyr.cloud.p2p.loan.biz.util.PLProcessorServiceAction.performGetResult(PLProcessorServiceAction.java:393) ~[com.hsyr.cloud.p2p.loan.biz-1.0.0-SNAPSHOT.jar:na]

at com.hsyr.cloud.p2p.loan.biz.util.PLProcessorServiceAction.reallyProcess(PLProcessorServiceAction.java:185) ~[com.hsyr.cloud.p2p.loan.biz-1.0.0-SNAPSHOT.jar:na]

at com.hsyr.cloud.p2p.loan.ctl.PLTaskServiceAction.processTaskServiceAction(PLTaskServiceAction.java:57) [com.hsyr.cloud.p2p.loan.ctl-1.0.0-SNAPSHOT.jar:na]

at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source) ~[na:na]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_45]

at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_45]

at org.tinygroup.commons.tools.ReflectionUtils.invokeMethod(ReflectionUtils.java:190) [org.tinygroup.commons-2.0.0.jar:na]

at org.tinygroup.weblayer.mvc.HandlerExecutionChain.execute(HandlerExecutionChain.java:133) [org.tinygroup.weblayer-2.0.0.jar:na]

at org.tinygroup.weblayer.mvc.impl.MappingModelExecuteImpl.execute(MappingModelExecuteImpl.java:40) [org.tinygroup.weblayer-2.0.0.jar:na]

at org.tinygroup.weblayer.tinyprocessor.MvcTinyProcessor.reallyProcess(MvcTinyProcessor.java:74) [org.tinygroup.weblayer-2.0.0.jar:na]

at org.tinygroup.weblayer.AbstractTinyProcessor.process(AbstractTinyProcessor.java:68) [org.tinygroup.weblayer-2.0.0.jar:na]

at org.tinygroup.weblayer.impl.TinyProcessorManagerImpl.execute(TinyProcessorManagerImpl.java:68) [org.tinygroup.weblayer-2.0.0.jar:na]

at org.tinygroup.weblayer.TinyFilterHandler.tinyFilterProcessor(TinyFilterHandler.java:107) [org.tinygroup.weblayer-2.0.0.jar:na]

at org.tinygroup.weblayer.impl.TinyFilterChain.doFilter(TinyFilterChain.java:62) [org.tinygroup.weblayer-2.0.0.jar:na]

at org.tinygroup.weblayer.filter.gzip.GZIPFilter.doFilter(GZIPFilter.java:75) [org.tinygroup.weblayer-2.0.0.jar:na]

at org.tinygroup.weblayer.impl.TinyFilterChain.doFilter(TinyFilterChain.java:59) [org.tinygroup.weblayer-2.0.0.jar:na]

at org.tinygroup.weblayer.impl.TinyFilterWrapper.filterWrapper(TinyFilterWrapper.java:79) [org.tinygroup.weblayer-2.0.0.jar:na]

at org.tinygroup.weblayer.TinyHttpFilter.doFilter(TinyHttpFilter.java:142) [org.tinygroup.weblayer-2.0.0.jar:na]

at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1288) [jetty-servlet-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:443) [jetty-servlet-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137) [jetty-server-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:532) [jetty-security-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227) [jetty-server-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1044) [jetty-server-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:372) [jetty-servlet-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:189) [jetty-server-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:978) [jetty-server-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135) [jetty-server-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255) [jetty-server-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154) [jetty-server-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116) [jetty-server-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.server.Server.handle(Server.java:369) [jetty-server-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:486) [jetty-server-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:933) [jetty-server-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:995) [jetty-server-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644) [jetty-http-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235) [jetty-http-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82) [jetty-server-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667) [jetty-io-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52) [jetty-io-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608) [jetty-util-7.6.17.v20150415.jar:7.6.17.v20150415]

at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543) [jetty-util-7.6.17.v20150415.jar:7.6.17.v20150415]

at java.lang.Thread.run(Thread.java:662) [na:1.6.0_45]

Caused by: java.lang.reflect.InvocationTargetException: null

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.6.0_45]

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ~[na:1.6.0_45]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_45]

at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_45]

at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:216) ~[org-exp-redis-1.0.0.jar:na]

at org.tinygroup.service.ServiceProxy.execute(ServiceProxy.java:150) ~[org.tinygroup.service-2.0.0.jar:na]

... 49 common frames omitted

Caused by: org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException: Connection.close() has already been called. Invalid
operation in this state.

at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:238) ~[spring-jdbc-2.5.6.jar:2.5.6]

at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:374) ~[spring-tx-2.5.6.jar:2.5.6]

at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:263) ~[spring-tx-2.5.6.jar:2.5.6]

at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:101) ~[spring-tx-2.5.6.jar:2.5.6]

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) ~[spring-aop-2.5.6.jar:2.5.6]

at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89) ~[spring-aop-2.5.6.jar:2.5.6]

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) ~[spring-aop-2.5.6.jar:2.5.6]

at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) ~[spring-aop-2.5.6.jar:2.5.6]

at com.sun.proxy.$Proxy16.addCreditSerial(Unknown Source) ~[na:na]

at com.hsyr.cloud.p2p.loan.svr.credit.PLCreditService.addCreditSerialForUpdate(PLCreditService.java:323) ~[com.hsyr.cloud.p2p.loan.service-1.0.0-SNAPSHOT.jar:na]

at com.hsyr.cloud.p2p.loan.svr.credit.PLCreditService.updateCreditRemain(PLCreditService.java:291) ~[com.hsyr.cloud.p2p.loan.service-1.0.0-SNAPSHOT.jar:na]

... 55 common frames omitted

Caused by: com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException: Connection.close() has already been called. Invalid operation in this state.

at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:888) ~[mysql-connector-java-5.0.5.jar:na]

at com.mysql.jdbc.Connection.getMutex(Connection.java:3714) ~[mysql-connector-java-5.0.5.jar:na]

at com.mysql.jdbc.Connection.setAutoCommit(Connection.java:5341) ~[mysql-connector-java-5.0.5.jar:na]

at org.apache.commons.dbcp.DelegatingConnection.setAutoCommit(DelegatingConnection.java:331) ~[commons-dbcp-1.2.2.jar:1.2.2]

at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.setAutoCommit(PoolingDataSource.java:317) ~[commons-dbcp-1.2.2.jar:1.2.2]

at sun.reflect.GeneratedMethodAccessor42.invoke(Unknown Source) ~[na:na]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_45]

at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_45]

at org.tinygroup.dynamicdatasource.DynamicDataSource$ConnectionInvocationHandler.invoke(DynamicDataSource.java:227) ~[org.tinygroup.dynamicdatasource-2.0.0.jar:na]

at com.sun.proxy.$Proxy21.setAutoCommit(Unknown Source) ~[na:na]

at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:221) ~[spring-jdbc-2.5.6.jar:2.5.6]

... 65 common frames omitted

有一个参数说明一下:testOnBorrow true 指明是否在从池中取出连接前进行检验,如果检验失败,则从池中去除连接并尝试取出另一个.

<property name="testOnBorrow">

<value>trues</value>

</property>

这个参数设为true时,还有一个参数的设置:validationQuery:SQL查询,用来验证从连接池取出的连接,在将连接返回给调用者之前.如果指定,则查询必须是一个SQL SELECT并且必须返回至少一行记录

如果testOnBorrow为true而validationQuery没有设置,或为空,或你给的不是一个select语句且没有数据返回。testOnBorrow也是白设。validationQuery这个的SQL语句一般查询dual表.常用的有SELECT 1 FROM DUAL。最也不要使用SELECT sysdate FROM DUAL.这个语句的效率没有前面说的一个好。WebLogic
就是使用的SELECT 1 FROM DUAL这个sql语句。

<property name="testOnBorrow">

<value>true</value>

</property>

<property name="validationQuery">

<value>SELECT 1 FROM DUAL</value>

</property>

要正式系统中使用的数据源最好是用上这个testOnBorrow。这样可以保证使用的每个数据源都不会出现长时间没有使用中断后。出现Could not close JDBC Connection这种问题。

版权声明:本文为博主原创文章,未经博主允许不得转载。

时间: 2024-10-13 15:12:56

今天线上系统碰到个怪问题DBCP数据连接异常,java.sql.SQLException: Already closed.的相关文章

关于初次使用java jdbc遇到数据库连接不上的问题java.sql.SQLException: No suitable driver found for jdbc:mysql://127.0.0.1:3306/test

首先我们写java有很大一部分的程序员使用的是神器ecplise 那我晒晒我写的ecplise有错误的代码(其实并不是代码错误了) 就类似这样的代码,首先你需要安装mysql在你的电脑上root就是用户名,密码当然就是你设置的密码 然后我们就会出现这样的错误信息 java.lang.ClassNotFoundException: com.mysql.jdbc.Driver at java.net.URLClassLoader.findClass(URLClassLoader.java:381) 

Caused by: java.sql.SQLException: Access denied for user &#39;root&#39;@&#39;192.168.6.131&#39; (using password: YES),远程连接数据库,连接不上解决方案

进入 mysql   ; use mysql; 然后 执行 GRANT ALL PRIVILEGES ON *.* TO [email protected]"你.的.端.口" IDENTIFIED BY "你的密码" WITH GRANT OPTION; FLUSH PRIVILEGES; 然后成功 Caused by: java.sql.SQLException: Access denied for user 'root'@'192.168.6.131' (usi

关于 64位系统 java连接access 报错java.sql.SQLException: [Microsoft][ODBC 驱动程序管理器] 未发现数据源名称并且未指定默认驱动程序

报错的原因是url = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=E:/公司/2000.mdb"; 这样是不行滴,要改成 url = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=E:/公司/2000.mdb"; 我去,网上找了好久好久,才找到...

CC2540是一款高性价比,低功耗片上系统(Soc)解决方案,它适合蓝牙低功耗应用领域

CC2540是一款高性价比,低功耗片上系统(Soc)解决方案,它适合蓝牙低功耗应用领域,极少的外围元器件以及强大网络节点建立成为可能.CC2540是一款含有高速和低功耗8051内核的RF收发器.适用于低功耗系统,有超低功耗的睡眠模式以及超低功耗运行模式. 市场上流通广泛的两款 CC2540F128及CC2540F256的区别如下: CC2540F128 含有128KB 程序Flash及8KB RAM; CC2540F256 含有256KB 程序Flash及8KB RAM; CC2540是深圳市动

监控线上系统异常日志

在监控线上系统时,需要实时监控异常日志信息,想到三种办法: 1.在应用代码里调用报警逻辑.如,catch到异常时,在catch代码块里调用报警接口. 2.使用shell脚本,如,tail -f | grep '***'.tail -f会间隔一秒读取日志内容,通过grep设置关键字,可以读取异常欣喜. 3.使用监控工具,如,Nagios. 监控线上系统异常日志,码迷,mamicode.com

上:Spark VS Flink – 下一代大数据计算引擎之争,谁主沉浮?

作者简介 王海涛,曾经在微软的 SQL Server和大数据平台组工作多年.带领团队建立了微软对内的 Spark 服务,主打 Spark Streaming.去年加入阿里实时计算部门,参与改进阿里基于 Apache Flink 的Blink 平台. 导读: 做大数据绝对躲不过的一个热门话题就是实时流计算,而提到实时流计算,就不得不提 Spark 和 Flink.Spark 从 2014 年左右开始迅速流行,刚推出时除了在某些场景比 Hadoop MapReduce 带来几十到上百倍的性能提升外,

vue10行代码实现上拉翻页加载更多数据,纯手写js实现下拉刷新上拉翻页不引用任何第三方插件

vue10行代码实现上拉翻页加载更多数据,纯手写js实现下拉刷新上拉翻页不引用任何第三方插件/库 一提到移动端的下拉刷新上拉翻页,你可能就会想到iScroll插件,没错iScroll是一个高性能,资源占用少,无依赖,多平台的javascript滚动插件.iScroll不仅仅是 滚动.它可以处理任何需要与用户进行移动交互的元素.在你的项目中包含仅仅4kb大小的iScroll,你的项目便拥有了滚动,缩放,平移,无限滚动,视差滚动,旋转功能.iScroll的强大毋庸置疑,本人也非常欢迎大家使用iScr

赵雅智_android系统联系人app分析并获取数据

手机联系人存放位置 和短信一样在data-data下 手机联系人数据库解析 将contacts2.db表导出,通过SQLiteexpert查看 mimetypes表:存放的数据类型(电话,头像,姓名,邮箱) 外键: raw_contacts表:存放联系人的id contact_id:联系人id display_name:联系人姓名 data表:存放联系人的数据 data1:联系人数据 data2:在mimetypes表中data1表示值得意义 mimetype_id:联系人ID,data数据所属

WIN7系统 64位出现 Net Framework 数据提供程序要求 Microsoft Data Access Components(MDAC).

WIN7系统 64位出现  Net Framework 数据提供程序要求 Microsoft Data Access Components(MDAC).请安装 Microsoft Data Access Components(MDAC)2.6或更高的版本.怎么解决,已经下载了2.8版本安装了,但是还是不顶用. 2015-12-02 10:51网友采纳 这应该是你安装的系统有精简过系统文件,导致安装一些程序缺乏文件出错.换个系统吧.可到我的系统贴吧下载GHO系统与GHO安装工具,可以在进入现在的系