java.sql.SQLRecoverableException: IO 错误: Socket closed

今天weblogic的alllog日志报了很多socket closed的错误。

### Cause: org.hibernate.exception.JDBCConnectionException: IO 错误: Socket closed

at com.gg.corm.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23) ~[gg-top-corm-3.1.2-20141209.jar:na]

at com.gg.corm.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:104) ~[gg-top-corm-3.1.2-20141209.jar:na]

at com.gg.corm.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:95) ~[gg-top-corm-3.1.2-20141209.jar:na]

at com.gg.corm.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:59) ~[gg-top-corm-3.1.2-20141209.jar:na]

at com.gg.sproc.core.base.dao.MyBatisDAO$6.execute(MyBatisDAO.java:241) ~[sproc-core-1.3.1-20141225.jar:1.3.1-20141225]

at org.hibernate.jdbc.WorkExecutor.executeWork(WorkExecutor.java:54) ~[com.gg.top.thirdparty-hibernate-core-4.1.9.Final.jar:4.1.9.Final]

at org.hibernate.internal.SessionImpl$2.accept(SessionImpl.java:1936) ~[com.gg.top.thirdparty-hibernate-core-4.1.9.Final.jar:4.1.9.Final]

at org.hibernate.internal.SessionImpl$2.accept(SessionImpl.java:1933) ~[com.gg.top.thirdparty-hibernate-core-4.1.9.Final.jar:4.1.9.Final]

at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.coordinateWork(JdbcCoordinatorImpl.java:211) ~[com.gg.top.thirdparty-hibernate-core-4.1.9.Final.jar:4.1.9.Final]

at org.hibernate.internal.SessionImpl.doWork(SessionImpl.java:1954) ~[com.gg.top.thirdparty-hibernate-core-4.1.9.Final.jar:4.1.9.Final]

at org.hibernate.internal.SessionImpl.doWork(SessionImpl.java:1940) ~[com.gg.top.thirdparty-hibernate-core-4.1.9.Final.jar:4.1.9.Final]

at com.gg.sproc.core.base.dao.MyBatisDAO.getObject(MyBatisDAO.java:236) ~[sproc-core-1.3.1-20141225.jar:1.3.1-20141225]

... 75 common frames omitted

Caused by: org.hibernate.exception.JDBCConnectionException: IO 错误: Socket closed

at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:131) ~[com.gg.top.thirdparty-hibernate-core-4.1.9.Final.jar:4.1.9.Final]

at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49) ~[com.gg.top.thirdparty-hibernate-core-4.1.9.Final.jar:4.1.9.Final]

at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125) ~[com.gg.top.thirdparty-hibernate-core-4.1.9.Final.jar:4.1.9.Final]

at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:110) ~[com.gg.top.thirdparty-hibernate-core-4.1.9.Final.jar:4.1.9.Final]

at org.hibernate.engine.jdbc.internal.proxy.AbstractStatementProxyHandler.continueInvocation(AbstractStatementProxyHandler.java:129) ~[com.gg.top.thirdparty-hibernate-core-4.1.9.Final.jar:4.1.9.Final]

at org.hibernate.engine.jdbc.internal.proxy.AbstractProxyHandler.invoke(AbstractProxyHandler.java:81) ~[com.gg.top.thirdparty-hibernate-core-4.1.9.Final.jar:4.1.9.Final]

at com.sun.proxy.$Proxy250.execute(Unknown Source) ~[na:na]

at com.gg.corm.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:56) ~[gg-top-corm-3.1.2-20141209.jar:na]

at com.gg.corm.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:70) ~[gg-top-corm-3.1.2-20141209.jar:na]

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

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_40]

at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_40]

at com.gg.corm.plugin.Plugin.invoke(Plugin.java:59) ~[gg-top-corm-3.1.2-20141209.jar:na]

at com.sun.proxy.$Proxy234.query(Unknown Source) ~[na:na]

at com.gg.corm.executor.SimpleExecutor.doQuery(SimpleExecutor.java:69) ~[gg-top-corm-3.1.2-20141209.jar:na]

at com.gg.corm.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:267) ~[gg-top-corm-3.1.2-20141209.jar:na]

at com.gg.corm.executor.BaseExecutor.query(BaseExecutor.java:141) ~[gg-top-corm-3.1.2-20141209.jar:na]

at com.gg.corm.executor.CachingExecutor.query(CachingExecutor.java:105) ~[gg-top-corm-3.1.2-20141209.jar:na]

at com.gg.corm.executor.CachingExecutor.query(CachingExecutor.java:81) ~[gg-top-corm-3.1.2-20141209.jar:na]

at com.gg.corm.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:101) ~[gg-top-corm-3.1.2-20141209.jar:na]

... 85 common frames omitted

Caused by: java.sql.SQLRecoverableException: IO 错误: Socket closed

at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:897) ~[ojdbc6.jar:11.2.0.3.0]

at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1167) ~[ojdbc6.jar:11.2.0.3.0]

at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1289) ~[ojdbc6.jar:11.2.0.3.0]

at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3594) ~[ojdbc6.jar:11.2.0.3.0]

at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3695) ~[ojdbc6.jar:11.2.0.3.0]

at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1378) ~[ojdbc6.jar:11.2.0.3.0]

at weblogic.jdbc.wrapper.PreparedStatement.execute(PreparedStatement.java:101) ~[weblogic.server.merged.jar:12.1.2.0.0]

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

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_40]

at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_40]

at org.hibernate.engine.jdbc.internal.proxy.AbstractStatementProxyHandler.continueInvocation(AbstractStatementProxyHandler.java:122) ~[com.gg.top.thirdparty-hibernate-core-4.1.9.Final.jar:4.1.9.Final]

... 100 common frames omitted

Caused by: java.net.SocketException: Socket closed

at java.net.SocketInputStream.socketRead0(Native Method) ~[na:1.7.0_40]

at java.net.SocketInputStream.read(SocketInputStream.java:152) ~[na:1.7.0_40]

at java.net.SocketInputStream.read(SocketInputStream.java:122) ~[na:1.7.0_40]

at oracle.net.ns.Packet.receive(Packet.java:300) ~[ojdbc6.jar:11.2.0.3.0]

at oracle.net.ns.DataPacket.receive(DataPacket.java:106) ~[ojdbc6.jar:11.2.0.3.0]

at oracle.net.ns.NetInputStream.getNextPacket(NetInputStream.java:315) ~[ojdbc6.jar:11.2.0.3.0]

at oracle.net.ns.NetInputStream.read(NetInputStream.java:260) ~[ojdbc6.jar:11.2.0.3.0]

at oracle.net.ns.NetInputStream.read(NetInputStream.java:185) ~[ojdbc6.jar:11.2.0.3.0]

at oracle.net.ns.NetInputStream.read(NetInputStream.java:102) ~[ojdbc6.jar:11.2.0.3.0]

at oracle.jdbc.driver.T4CSocketInputStreamWrapper.readNextPacket(T4CSocketInputStreamWrapper.java:124) ~[ojdbc6.jar:11.2.0.3.0]

at oracle.jdbc.driver.T4CSocketInputStreamWrapper.read(T4CSocketInputStreamWrapper.java:80) ~[ojdbc6.jar:11.2.0.3.0]

at oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1137) ~[ojdbc6.jar:11.2.0.3.0]

at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:290) ~[ojdbc6.jar:11.2.0.3.0]

at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192) ~[ojdbc6.jar:11.2.0.3.0]

at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531) ~[ojdbc6.jar:11.2.0.3.0]

at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:207) ~[ojdbc6.jar:11.2.0.3.0]

at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:884) ~[ojdbc6.jar:11.2.0.3.0]

... 110 common frames omitted

再检查server日志,发现在alllog中报socket closed错误的时段:

####<2015-1-5 上午11时37分22秒 CST> <Info> <JDBC> <scgg15140> <appServer> <[ACTIVE] ExecuteThread: ‘3‘ for queue: ‘weblogic.kernel.Default (self-tuning)‘> <<WLS Kernel>> <> <> <1420429042060> <BEA-001128> <Connection
for pool "ggDataSource" has been closed
.>

####<2015-1-5 上午11时38分32秒 CST> <Info> <JDBC> <scgg15140> <appServer> <[ACTIVE] ExecuteThread: ‘3‘ for queue: ‘weblogic.kernel.Default (self-tuning)‘> <<WLS Kernel>> <> <> <1420429112057> <BEA-001128> <Connection for pool "ggDataSource" has been closed.>

####<2015-1-5 上午11时38分52秒 CST> <Info> <JDBC> <scgg15140> <appServer> <[ACTIVE] ExecuteThread: ‘1‘ for queue: ‘weblogic.kernel.Default (self-tuning)‘> <<WLS Kernel>> <> <> <1420429132057> <BEA-001128> <Connection for pool "ggDataSource" has been closed.>

####<2015-1-5 上午11时51分32秒 CST> <Info> <JDBC> <scgg15140> <appServer> <[ACTIVE] ExecuteThread: ‘13‘ for queue: ‘weblogic.kernel.Default (self-tuning)‘> <<WLS Kernel>> <> <> <1420429892057> <BEA-001128> <Connection for pool "ggDataSource" has been closed.>

连接池关闭,有两种可能,一种是数据库出问题了,一种是网络问题导致连不上数据库了。

再次检查数据库的alert.log,没发现有异常,说明就是网络问题。

时间: 2024-10-12 21:42:34

java.sql.SQLRecoverableException: IO 错误: Socket closed的相关文章

ojdbc在linux环境下 java.sql.SQLRecoverableException: IO Error: Connection reset 的问题

开门见山,最快捷的解决方案:java -Djava.security.egd=file:///dev/urandom  -jar  xxxxxxx.jar 描述下问题:写了个jar工具,用到了连接池,ojdbc.windows环境一起正常.linux环境下启动关闭两三次后就出现 java.sql.SQLRecoverableException: IO 错误: Connection reset 查看配置文件和解析问题, 无果. 更换hikari到druid,无果. 使用最新ojdbc包,无果. 无

解决weblogic错误:java.sql.SQLRecoverableException: IO Error: Broken pipe

首先说一下系统基础架构: 服务器:weblogic11g集群 数据库:oracle数据库Rac 出错信息: 1.java.sql.SQLRecoverableException: Closed Connection 2.Test "SELECT 1 FROM DUAL" set up for pool "mds-soa" failed with exception: "java.sql.SQLRecoverableException: IO Error:

nested exception is java.sql.SQLException: IO 错误

1.错误描述 (mx.messaging.messages::ErrorMessage)#0 body = (null) clientId = "18CE3B03-9709-9DA8-7634-340C23317FDD" correlationId = "3161DF25-D056-D694-E5CF-963E4FE036D9" destination = "waitController" extendedData = (null) faultC

java连接oracle数据库,关闭连接出现异常:java.sql.SQLRecoverableException: IO Error: Connection reset

java.sql.SQLRecoverableException: IO Error: Connection reset at oracle.jdbc.driver.T4CConnection.logoff(T4CConnection.java:612) at oracle.jdbc.driver.PhysicalConnection.close(PhysicalConnection.java:5094) at com.sms.send.StartTaskNew.run(SmsSend.java

Linux 使用命令执行java -jar xxx.jar 在连接数据库时发生 java.sql.SQLRecoverableException: IO Error: Connection reset 错误

一.问题描述 1. jar 包在未打包之前执行没有问题 2.应用启动慢,并且此问题是一个偶尔性质的,也就是时有时无, 3.数据库连接数够用 4.发生错误的该连接是一个新的连接,不是服务端关闭导致的问题 二.问题原因 在Linux操作系统中,有一个特殊的设备文件,可以用作随机数发生器或伪随机数发生器. /dev/random 在读取时,/dev/random设备会返回小于熵池噪声总数的随机字节./dev/random可生成高随机性的公钥或一次性密码本.若熵池空了,对/dev/random的读操作将

在linux上通过JDBC连接ORACLE 时总是出现 java.sql.SQLRecoverableException: IO Error: Connection reset 的问题

如标题所述,经过和度娘沟通了不知道多少遍最后看一篇文章解决, 我是通过执行jar来操作DB的.所以在命令中加了一个参数( 加粗,红色) eg: $JAVA_EXE -Djava.security.egd=file:///dev/urandom  -jar  xxxxxxx.jar 最终测试OK 参考的文章出处是:http://www.feexion.com/?p=247

Io 异常: Socket closed

java.sql.SQLException: Io 异常: Socket closed at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146) at oracle.jdbc.driver.DatabaseError.throwSqlExcept

关于java.sql.SQLRecoverableException: Closed Connection异常的解决方案(转)

在项目中碰到了一个应用异常,从表象来看应用僵死.查看Weblogic状态为Running,内存无溢出,但是出现多次线程堵塞.查看Weblogic日志,发现程序出现多次Time Out. 我们知道,Weblogic会自动检测线程运行超时,当超过特点时间(默认600S),即认为此线程为堵塞线程.在日志中发现多次堵塞线程,通过查找资料,发现Weblogic在发生多次线程堵塞后,会自动把应用挂起.默认次数为15次. 是什么造成了线程堵塞呢?通过进一步分析日志,我们发现在线程堵塞之前,发生了多次java.

java.sql.SQLException: Io 异常: Got minus one from a read call

博客分类: Oracle Tomcat服务器下的应用连接Oracle时报错,出现以下异常: java.sql.SQLException: Io 异常: Got minus one from a read call 查询数据库连接情况: Java代码   SQL> select username,count(username) from v$session where username is not null group by username; USERNAME