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




posted @ 2012-01-20 13:53  __BSD__  阅读(3571)  评论(0编辑  收藏  举报