今天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,没发现有异常,说明就是网络问题。