Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
315 views
in Technique[技术] by (71.8m points)

Tomcat Not Starting Through Eclipse (Timeout)

I am trying to run Tomcat through Eclipse. This is something that I have done for the past several years. It was working yesterday and now it is not. The error I get is

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.

The Output is

Jul 06, 2012 8:32:26 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:Program FilesJavajdk1.7.0_05in;C:WindowsSunJavain;C:Windowssystem32;C:Windows;C:Program Files (x86)NVIDIA CorporationPhysXCommon;C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSystem32WindowsPowerShellv1.0;C:Program Files (x86)QuickTimeQTSystem;D:Launch;D:Program FilesJavajdk1.7.0_05in;%PROGRAMFILES%Internet Explorer;C:Program Files (x86)SMLNJin;D:Program FilesTortoiseSVNin;C:ghcghc-6.6in;D:Program FilesMySQLMySQL Server 5.5in;%ANT_HOME%/bin;D:Program Files (x86)Microsoft SQL Server100ToolsBinn;D:Program FilesMicrosoft SQL Server100ToolsBinn;D:Program FilesMicrosoft SQL Server100DTSBinn;D:Program Files (x86)Microsoft SQL Server100ToolsBinnVSShellCommon7IDE;C:Program Files (x86)Microsoft Visual Studio 9.0Common7IDEPrivateAssemblies;D:Program Files (x86)Microsoft SQL Server100DTSBinn;D:Program Files (86x);.
Jul 06, 2012 8:32:26 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Jul 06, 2012 8:32:26 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Jul 06, 2012 8:32:26 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 468 ms
Jul 06, 2012 8:32:26 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Jul 06, 2012 8:32:26 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.28
Jul 06, 2012 8:32:26 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:Program FilesJavaapache-tomcat-7.0.28webappsdocs
Jul 06, 2012 8:32:26 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:Program FilesJavaapache-tomcat-7.0.28webappsexamples
Jul 06, 2012 8:32:26 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Jul 06, 2012 8:32:26 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Jul 06, 2012 8:32:26 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache@5710ddf9')
Jul 06, 2012 8:32:26 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:Program FilesJavaapache-tomcat-7.0.28webappshost-manager
Jul 06, 2012 8:32:26 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:Program FilesJavaapache-tomcat-7.0.28webappsmanager
Jul 06, 2012 8:32:26 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:Program FilesJavaapache-tomcat-7.0.28webappsROOT
Jul 06, 2012 8:32:26 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Jul 06, 2012 8:32:26 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Jul 06, 2012 8:32:26 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 504 ms

I have looked around for a solution for several hours now. But I have not had any success and it likely is something simple. I have tried the following:

  1. Delete Serve and remake it in eclipse
  2. Restart computer, eclipse
  3. Reinstall eclipse, tomcat
  4. Start Eclipse with -clean
  5. Start server with no web app
  6. Increasing the timeout

I am able to start tomcat from command line just fine. However, I need to run it through eclipse to debug. I am aware of this SO post and have gone through it and many others to no avail.

Thoughts?

UPDATE: I just realized that the server does start up. However, one of the final functions that eclipse does, fails. How I observed this is by setting the timeout to 10 min. I was able to access the server during that time, however not the debug functionality of eclipse. So Eclipse starts it up, tries do something, that something never completes, Eclipse shuts down Tomcat after that timeout period.

UPDATE: Looking back at what happened around when this problem arose, the computer apparently installed a Java update.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

A Java update caused the same problem (among others) for me. The update caused Eclipse to use ipv6 when pinging Tomcat and for some reason that doesn't work with my setup.

I fixed it by adding

-Djava.net.preferIPv4Stack=true

To eclipse.ini.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...