Eclipse中無法啟動Apache Tomcat 7.0 Server


問題

今天在使用SpringSource ToolSuite啟動Tomcat時發現Eclipse WTP拋出這樣的錯誤信息:
Server Tomcat v7. 0 Server at localhost was unable to start within 45 seconds. If the server requires more time, try increasing the timeout in the server editor.

解決辦法

Google后發現, 網上的其他人也碰到過這樣的問題。
 
Eclipse forums中,我們可以找出此類問題的一般解決方法。
Larry Isaacs explains :

The lack of output in the Console view suggests that the attempt to launch Tomcat is failing. After attempting to start Tomcat, switch to the Debug perspective and look in the Debug window. You should see a terminated launch. You can right -click on the nested item under the terminated launch and select Properties. This should display the command line that is being used to launch Tomcat. You could try that command in a terminal window to see what happens.
從上述解釋,通過右鍵查看terminated lanch,可以知道Eclipse在后台使用的命令。
這里的命令是javaw.exe(注意,javaw程序不在console中輸出任何東西)。
 
 
可以把javaw.exe替換為java.exe,並在命令行中重新運行此命令,就能方便地定位出啟動過程過長的原因。
D :\ >D :\develop\language\java\jdk\jre\bin\java.exe -Dcatalina.base =E :\work\projects\PricingTool\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1 -Dcatalina.home =D :\develop\ide\springsource\apache -tomcat - 7. 0. 23 -Dwtp.deploy =E :\work\projects\PricingTool\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps -Djava.endorsed.dirs =D :\develop\ide\springsource\apache -tomcat - 7. 0. 23\endorsed -Dfile.encoding =UTF - 8 -classpath D :\develop\ide\springsource\apache -tomcat - 7. 0. 23\bin\bootstrap.jar;D :\develop\ide\springsource\apache -tomcat - 7. 0. 23\bin\tomcat -juli.jar org.apache.catalina.startup.Bootstrap start 
Jan 20, 2012 1 : 43 : 33 PM org.apache.catalina.core.AprLifecycleListener init
INFO : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path : D :\develop\language\java\jdk\jre\bin;C :\Windows\Sun\Java\bin;C :\Windows\system32;C :\Windows;D :\develop\oracle\product\ 11. 2. 0\client_1\bin;D :\develop\language\java\jdk\bin;C :\Program Files (x86)\RSA SecurID Token Common;C :\Windows\system32;C :\Windows;C :\Windows\System32\Wbem;C :\Windows\System32\WindowsPowerShell\v1. 0\;C :\Program Files\Intel\WiFi\bin\;C :\Program Files\Common Files\Intel\WirelessCommon\;D :\Program Files (x86)\Tencent\QQPCMgr\ 6. 6. 2136. 201;D :\Program Files\TortoiseSVN\bin;C :\Program Files\Intel\WiFi\bin\;C :\Program Files\Common Files\Intel\WirelessCommon\;D :\Program Files (x86)\Tencent\QQPCMgr\ 6. 6. 2136. 201;.
Jan 20, 2012 1 : 43 : 34 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING : [SetPropertiesRule]{Server /Service /Engine /Host /Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:PricingToolsWF' did not find a matching property.
Jan 20, 2012 1 : 43 : 34 PM org.apache.coyote.AbstractProtocol init
INFO : Initializing ProtocolHandler [ "http-bio-8080"]
Jan 20, 2012 1 : 43 : 34 PM org.apache.coyote.AbstractProtocol init
INFO : Initializing ProtocolHandler [ "ajp-bio-8009"]
Jan 20, 2012 1 : 43 : 34 PM org.apache.catalina.startup.Catalina load
INFO : Initialization processed in 1065 ms
Jan 20, 2012 1 : 43 : 34 PM org.apache.catalina.core.StandardService startInternal
INFO : Starting service Catalina
Jan 20, 2012 1 : 43 : 34 PM org.apache.catalina.core.StandardEngine startInternal
INFO : Starting Servlet Engine : Apache Tomcat / 7. 0. 23
Jan 20, 2012 1 : 43 : 36 PM org.apache.catalina.core.ApplicationContext log
INFO : Initializing Spring root WebApplicationContext
2012 - 01 - 20 13 : 43 : 41, 489 [pool - 2 -thread - 1] INFO com.avnet.em.pricingtool.service.listener.ApplicationContextListener - App started
2012 - 01 - 20 13 : 43 : 41, 491 [pool - 2 -thread - 1] INFO com.avnet.em.pricingtool.service.listener.ApplicationContextListener - 1399004
2012 - 01 - 20 13 : 43 : 41, 494 [pool - 2 -thread - 1] INFO com.avnet.em.pricingtool.service.listener.ApplicationContextListener - org.springframework.context.event.Context
RefreshedEvent[source =Root WebApplicationContext : startup date [Fri Jan 20 13 : 43 : 36 CST 2012]; root of context hierarchy]
Jan 20, 2012 1 : 43 : 41 PM org.apache.catalina.core.ApplicationContext log
INFO : Initializing Spring FrameworkServlet 'PricingToolsWF'
Jan 20, 2012 1 : 43 : 43 PM org.apache.coyote.AbstractProtocol start
INFO : Starting ProtocolHandler [ "http-bio-8080"]
Jan 20, 2012 1 : 43 : 43 PM org.apache.coyote.AbstractProtocol start
INFO : Starting ProtocolHandler [ "ajp-bio-8009"]
Jan 20, 2012 1 : 43 : 43 PM org.apache.catalina.startup.Catalina start
INFO : Server startup in 9368 ms





免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM