Tomcat下多个JFinal项目运行

33号小人物 发布于 2015/07/17 11:01
阅读 862
收藏 0

目前在Linux服务器的Tomcat中,部署了多个JFinal的应用,每个项目都利用C3P0去管理连接池,包括Mysql、DB2、Oracle。后来查看tomcat的日志发现,会出现A C3P0Registry mbean is already registered的告警,上网查询说,应该把C3P0托管给WEB服务器,即Tomcat,因此就把每个项目里的C3P0包以及各数据库的驱动包都放到tomcat的lib目录下。但是现在发现Tomcat的日志里又有以下异常:

17-Jul-2015 05:44:59.685 WARNING [Timer-3] com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector.run com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@13d03ca8 -- APPARENT DEADLOCK!!! Creating emergency threads for unassigned pending tasks!
17-Jul-2015 05:44:59.689 WARNING [Timer-3] com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector.run com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@13d03ca8 -- APPARENT DEADLOCK!!! Complete Status: 


17-Jul-2015 05:45:59.701 WARNING [Timer-3] com.mchange.v2.async.ThreadPoolAsynchronousRunner.processReplacedThreads Task com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask@23312bfd (in deadlocked PoolThread) failed to complete in maximum time 60000ms. Trying interrupt().
17-Jul-2015 05:45:59.701 WARNING [Timer-3] com.mchange.v2.async.ThreadPoolAsynchronousRunner.processReplacedThreads Task com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask@713f0117 (in deadlocked PoolThread) failed to complete in maximum time 60000ms. Trying interrupt().
17-Jul-2015 05:45:59.701 WARNING [Timer-3] com.mchange.v2.async.ThreadPoolAsynchronousRunner.processReplacedThreads Task com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask@1ac78dd7 (in deadlocked PoolThread) failed to complete in maximum time 60000ms. Trying interrupt().
17-Jul-2015 06:00:09.590 INFO [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0] com.mchange.v2.c3p0.impl.NewPooledConnection.logCloseExceptions [c3p0] Exceptions occurred while trying to close a PooledConnection's resources normally.
17-Jul-2015 06:00:09.591 INFO [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0] com.mchange.v2.c3p0.impl.NewPooledConnection.logCloseExceptions [c3p0] NewPooledConnection close Exception.
 java.sql.SQLRecoverableException: IO 错误: 连接超时
at oracle.jdbc.driver.T4CConnection.logoff(T4CConnection.java:556)
at oracle.jdbc.driver.PhysicalConnection.close(PhysicalConnection.java:3984)
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:549)
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:234)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:470)
at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:964)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
Caused by: java.net.SocketException: 连接超时
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:152)
at java.net.SocketInputStream.read(SocketInputStream.java:122)
at oracle.net.ns.Packet.receive(Packet.java:300)
at oracle.net.ns.DataPacket.receive(DataPacket.java:106)
at oracle.net.ns.NetInputStream.getNextPacket(NetInputStream.java:315)
at oracle.net.ns.NetInputStream.read(NetInputStream.java:260)
at oracle.net.ns.NetInputStream.read(NetInputStream.java:185)
at oracle.net.ns.NetInputStream.read(NetInputStream.java:102)
at oracle.jdbc.driver.T4CSocketInputStreamWrapper.readNextPacket(T4CSocketInputStreamWrapper.java:124)
at oracle.jdbc.driver.T4CSocketInputStreamWrapper.read(T4CSocketInputStreamWrapper.java:80)
at oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1137)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:290)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192)
at oracle.jdbc.driver.T4C7Ocommoncall.doOLOGOFF(T4C7Ocommoncall.java:61)
at oracle.jdbc.driver.T4CConnection.logoff(T4CConnection.java:543)
... 6 more


17-Jul-2015 06:00:09.592 INFO [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2] com.mchange.v2.c3p0.impl.NewPooledConnection.logCloseExceptions [c3p0] Exceptions occurred while trying to close a PooledConnection's resources normally.
17-Jul-2015 06:00:09.592 WARNING [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0] com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run Failed to destroy resource: com.mchange.v2.c3p0.impl.NewPooledConnection@5befa72a
 java.sql.SQLException: Some resources failed to close properly while closing com.mchange.v2.c3p0.impl.NewPooledConnection@5befa72a
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:571)
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:234)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:470)
at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:964)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)

我们的多个项目都是作为微信公众号的后台应用,偶尔会出现点击菜单无响应的情况,查看日志也没有日志报错,我怀疑是项目与Oracle数据库链接的问题,因此想从这方面去着手。请教一下,有什么好的解决思路,谢谢!

加载中
0
糊搞

先参考这个,兴许能解答你的问题:http://www.oschina.net/question/2414161_243376

0
JFinal
JFinal
换 DruidPlugin 
33号小人物
33号小人物
我改过来了,但是还是会发生同样的问题,应该是数据库的原因。
返回顶部
顶部