在系统日志中找到下面的错误日志:
2014-10-24 10:25:00.508 [mqTaskExecutor-19] ERROR o.s.t.i.TransactionInterceptor -Application exception overridden by rollback exception
org.springframework.dao.DataAccessResourceFailureException: PreparedStatementCallback; SQL [INSERT INTO RE_CORDEROPERATE ( OPERATESTATUS, operatetime, operatedesc, b2citemno, SUPPLIERCODE, EXCEPTIONDESC, OPERATEEMPLOYEE, CREATETIME ) VALUES ( ?, ?, ?, ?, ?, '', ?, CURRENT_TIMESTAMP )]; The last packet successfully received from the server was 46,677,980 milliseconds ago. The last packet sent successfully to the server was 46,677,981 milliseconds ago. 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.; nested exception is com.ibm.websphere.ce.cm.StaleConnectionException: The last packet successfully received from the server was 46,677,980 milliseconds ago. The last packet sent successfully to the server was 46,677,981 milliseconds ago. 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.
at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:104) ~[spring-jdbc-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) ~[spring-jdbc-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) ~[spring-jdbc-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) ~[spring-jdbc-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:603) ~[spring-jdbc-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:812) ~[spring-jdbc-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:834) ~[spring-jdbc-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.update(NamedParameterJdbcTemplate.java:260) ~[spring-jdbc-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.update(NamedParameterJdbcTemplate.java:264) ~[spring-jdbc-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at com.suning.framework.dal.client.support.executor.MappedSqlExecutor.execute4PrimaryKey(MappedSqlExecutor.java:689) ~[snf-dal-3.0.4.jar:na]
at com.suning.framework.dal.client.support.executor.MappedSqlExecutor.execute(MappedSqlExecutor.java:649) ~[snf-dal-3.0.4.jar:na]
at com.suning.framework.dal.client.support.ShardingDalClient.execute(ShardingDalClient.java:286) ~[snf-dal-sharding-1.0.6.jar:na]
at com.suning.moms.service.impl.ob.UnpaidOrderStatusImportServiceImpl.updateOrderItemStatus(UnpaidOrderStatusImportServiceImpl.java:108) ~[moms-admin-service-1.0.0.jar:na]
at com.suning.moms.service.impl.ob.UnpaidOrderStatusImportServiceImpl.saveCUnpaidOrderStatus(UnpaidOrderStatusImportServiceImpl.java:91) ~[moms-admin-service-1.0.0.jar:na]
at sun.reflect.GeneratedMethodAccessor73.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) ~[na:1.6.0]
at java.lang.reflect.Method.invoke(Method.java:611) ~[na:1.6.0]
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:319) [spring-aop-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) [spring-aop-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) [spring-aop-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95) [spring-tx-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) [spring-aop-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90) [spring-aop-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) [spring-aop-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) [spring-aop-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at $Proxy45.saveCUnpaidOrderStatus(Unknown Source) [na:na]
at com.suning.moms.service.impl.mq.MQMessageServiceImpl.chooseBusinessService(MQMessageServiceImpl.java:168) [moms-admin-service-1.0.0.jar:na]
at sun.reflect.GeneratedMethodAccessor62.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) ~[na:1.6.0]
at java.lang.reflect.Method.invoke(Method.java:611) ~[na:1.6.0]
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:319) [spring-aop-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) [spring-aop-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) [spring-aop-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95) [spring-tx-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) [spring-aop-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90) [spring-aop-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) [spring-aop-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) [spring-aop-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at $Proxy50.chooseBusinessService(Unknown Source) [na:na]
at com.suning.moms.service.impl.mq.MQImportThread.runEsbMessage(MQImportThread.java:133) [moms-admin-service-1.0.0.jar:na]
at com.suning.moms.service.impl.mq.MQImportThread.run(MQImportThread.java:64) [moms-admin-service-1.0.0.jar:na]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:897) [na:1.6.0]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:919) [na:1.6.0]
at java.lang.Thread.run(Thread.java:736) [na:1.6.0]
Caused by: com.ibm.websphere.ce.cm.StaleConnectionException: The last packet successfully received from the server was 46,677,980 milliseconds ago. The last packet sent successfully to the server was 46,677,981 milliseconds ago. 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.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.6.0]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:56) ~[na:1.6.0]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:39) ~[na:1.6.0]
at java.lang.reflect.Constructor.newInstance(Constructor.java:527) ~[na:1.6.0]
at com.ibm.websphere.rsadapter.GenericDataStoreHelper.mapExceptionHelper(GenericDataStoreHelper.java:615) ~[rsahelpers.jar:WAS70.SERV1 [cf211150.04]]
at com.ibm.websphere.rsadapter.GenericDataStoreHelper.mapException(GenericDataStoreHelper.java:677) ~[rsahelpers.jar:WAS70.SERV1 [cf211150.04]]
at com.ibm.ws.rsadapter.AdapterUtil.mapException(AdapterUtil.java:2112) ~[com.ibm.ws.runtime.jar:na]
at com.ibm.ws.rsadapter.jdbc.WSJdbcUtil.mapException(WSJdbcUtil.java:1034) ~[com.ibm.ws.runtime.jar:na]
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.setAutoCommit(WSJdbcConnection.java:3489) ~[com.ibm.ws.runtime.jar:na]
at org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy$LazyConnectionInvocationHandler.getTargetConnection(LazyConnectionDataSourceProxy.java:417) ~[spring-jdbc-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy$LazyConnectionInvocationHandler.invoke(LazyConnectionDataSourceProxy.java:376) ~[spring-jdbc-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at $Proxy68.prepareStatement(Unknown Source) ~[na:na]
at org.springframework.jdbc.core.PreparedStatementCreatorFactory$PreparedStatementCreatorImpl.createPreparedStatement(PreparedStatementCreatorFactory.java:245) ~[spring-jdbc-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:581) ~[spring-jdbc-3.1.2.RELEASE.jar:3.1.2.RELEASE]
... 39 common frames omitted
经过定位怀疑是数据库连接池中获取到的连接已经超时,长时间没有被使用导致超时。但是WAS上JDBC-数据源-定制属性-URL属性的值=jdbc:mysql://10.27.88.137:3306/moms_137?useUnicode=true&characterEncoding=utf8&autoReconnect=true这个的配置是对的,配置了自动重新连接。
但是 WAS上JDBC-数据源-WebSphere Application Server 数据源属性-通过 SQL 查询进行验证(不推荐在 V7 中使用)查询熟悉的值=SELECT 1 FROM DUMMYTABLE
,这个查询语句是错的,MYSQL应该写成SELECT 1 ,这样就避免了这个问题。
分享到:
相关推荐
WebSphere中流行数据库连接池的配置
论WebSphere中流行数据库连接池的配置.doc
WebSphere中流行数据库连接池的配置 本文介绍WebSphere下Oracle、SQL Server、Sybase、MySQL数据库连接池的配置方法,并给出相应调用连接池的示例。相对于Weblogic,WebSphere连接池的配置要稍微复杂一些,因为缺少...
论WebSphere中流行数据库连接池的配置
WebSphere配置数据库连接池
WebSphere数据库连接池配置.doc
数据库 连接池 原理 ...数据库连接池技术是解决这个问题最常用的方法,在许多应用程序服务器(例如:Weblogic,WebSphere,JBoss)中,基本都提供了这项技术,无需自己编程,但是,深入了解这项技术是非常必要的。
WebSphere中流行数据库连接池的配置(Oracle、SQL Server、Sybase、MySQL)
WebSphere数据库连接池配置[整理].pdf
超级经典WebSphere中流行数据库连接池的配置(Oracle、SQL_Server、Sybase、MySQL)
在实际项目的开发中,特别是web应用程序中,如Jsp,Servlet或EJB使用JDBC直接访问数据库中的数据,每一次数据方请求必须建立连接,存取数据,关闭连接等步骤,而数据库连接是一种非常昂贵的资源,频繁的建立连接,...
weblogic连接池配置数据库断掉重连的问题
WebSphere 流行数据库连接池的配置(Oracle、SQL+Server、Sybase、MySQL)
在WebLogic中建立数据库连接池与数据源及利用JBuilder进行测试.pdf
WebSphere中流行数据库连接池的配置(Oracle、SQL Server、Sybase、MySQL).doc
WebSphere参数讲解 连接池、连接超时 最大连接数概述 意义
相比于tomcat的项目部署,websphere中项目的部署还是还是很不一样的,本文档中图文并茂地讲述了,在Myeclipse中如何配置websphere以及如何部署web程序 另外,还详细讲解了如何在websphere中配置数据库连接池
远程连接DB2不多的可用教程,还有主机连接DB2数据库的相关教程。