java web ssh启动运行程序_[javaweb开发SSH] myeclipse启动tomcat时的bug
以前用的是myeclipse10.0的版本,我也不知道以前設(shè)置了什么,比較正常.由于以前的myeclipse無法裝svn,所以裝了一個(gè)10.7當(dāng)連接數(shù)據(jù)庫正常時(shí),自然是好的一旦連接數(shù)據(jù)庫不正常了(我故意將數(shù)...
以前用的是myeclipse10.0的版本, 我也不知道以前設(shè)置了什么,比較正常.
由于以前的myeclipse無法裝svn,所以裝了一個(gè)10.7
當(dāng)連接數(shù)據(jù)庫正常時(shí),自然是好的
一旦連接數(shù)據(jù)庫不正常了(我故意將數(shù)據(jù)庫連接弄錯(cuò)的), 它也不報(bào)錯(cuò),而是停在了
Initializing Spring root WebApplicationContext
這里分為兩種情況:
1,數(shù)據(jù)庫沒啟動
一直停在Initializing Spring root WebApplicationContext
直到很長時(shí)間才停止,約為正常啟動時(shí)間的50倍左右
用debug記錄日志,
發(fā)現(xiàn)一直在循環(huán)發(fā)送鏈接數(shù)據(jù)庫的語句,如下:
Last packet sent to the server was 0 ms ago.
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2847)
at com.mysql.jdbc.Connection.(Connection.java:1555)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
2,數(shù)據(jù)庫已經(jīng)啟動,但是連接數(shù)據(jù)庫參數(shù)出錯(cuò),用戶密碼錯(cuò)誤,導(dǎo)致無法連接的情況
停在Initializing Spring root WebApplicationContext
一段時(shí)間后,停止,用時(shí)約為正常啟動的10倍
用debug記錄日志如下:
WARN BasicResourcePool:1841 - com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@1774242 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception:
java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
只有用debug記錄日志方式才能看見異常.關(guān)閉日志后看不到
以前的版本,不會重復(fù)的去查數(shù)據(jù)庫,一旦出錯(cuò),馬上會在控制臺上顯示,無論用不用debug記錄日志.
所以樓主裝回以前版本, 竟然發(fā)現(xiàn)出現(xiàn)了跟現(xiàn)在版本一樣的情況
據(jù)此,樓主推測是myeclipse的設(shè)置問題,樓主以前可能配置或者設(shè)置了什么東西,而現(xiàn)在沒有設(shè)置,但樓主實(shí)在忘了以前是怎么設(shè)置的,希望各位大神幫幫忙!
展開
總結(jié)
以上是生活随笔為你收集整理的java web ssh启动运行程序_[javaweb开发SSH] myeclipse启动tomcat时的bug的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 工伤事故备案表的填写样本(工伤事故备案)
- 下一篇: java简单文本编译器_java -简易