问题描述
帮我看看咋回事啊?我搞不懂。就是运行很久的一个项目,最近突然就动不动就登陆不了,然后连首页都显示不出来了。然后只能重启服务,就又没问题了。老师需要重启。帮我看看日志全是这个,是什么意思啊?ERROR 2013-12-06 13:12:20,831 org.logicalcobwebs.proxool.GAP-Pool #0041 encountered errors during destruction: java.sql.SQLException: Io 异常: 连接超时at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:74)at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:131)at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:197)at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:261)at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:566)at oracle.jdbc.driver.T4CConnection.logoff(T4CConnection.java:500)at oracle.jdbc.driver.PhysicalConnection.close(PhysicalConnection.java:3509)at org.logicalcobwebs.proxool.ProxyConnection.reallyClose(ProxyConnection.java:192)at org.logicalcobwebs.proxool.ConnectionPool.removeProxyConnection(ConnectionPool.java:427)at org.logicalcobwebs.proxool.HouseKeeper.sweep(HouseKeeper.java:139)at org.logicalcobwebs.proxool.HouseKeeperThread.run(HouseKeeperThread.java:39)Caused by: java.net.SocketException: 连接超时at java.net.SocketInputStream.socketRead0(Native Method)at java.net.SocketInputStream.read(SocketInputStream.java:129)at oracle.net.ns.Packet.receive(Packet.java:240)at oracle.net.ns.DataPacket.receive(DataPacket.java:92)at oracle.net.ns.NetInputStream.getNextPacket(NetInputStream.java:172)at oracle.net.ns.NetInputStream.read(NetInputStream.java:117)at oracle.net.ns.NetInputStream.read(NetInputStream.java:92)at oracle.net.ns.NetInputStream.read(NetInputStream.java:77)at oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1034)at oracle.jdbc.driver.T4CMAREngine.unmarshalSB1(T4CMAREngine.java:1010)at oracle.jdbc.driver.T4C7Ocommoncall.receive(T4C7Ocommoncall.java:97)at oracle.jdbc.driver.T4CConnection.logoff(T4CConnection.java:487)... 5 more
解决方案
可能是连接池没有释放,建议proxypool的自动检测和释放
解决方案二:
可能是数据库连接太多,没有释放掉造成的。
解决方案三:
你使用的是proxool连接池,不知道你配置文件是怎么配置的,我觉得你可以加上<test-before-use>true</test-before-use> 这个属性,如果你数据库是oracle加上:<house-keeping-test-sql> select CURRENT_DATE </house-keeping-test-sql> 如果是mysql:<house-keeping-test-sql>SELECT 1</house-keeping-test-sql>希望可以帮到你!