Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tomcat Not Starting Through Eclipse (Timeout)

Tags:

eclipse

tomcat

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 Files\Java\jdk1.7.0_05\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\QuickTime\QTSystem\;D:\Launch;D:\Program Files\Java\jdk1.7.0_05\bin;%PROGRAMFILES%\Internet Explorer;C:\Program Files (x86)\SMLNJ\bin\;D:\Program Files\TortoiseSVN\bin;C:\ghc\ghc-6.6\bin;D:\Program Files\MySQL\MySQL Server 5.5\bin;%ANT_HOME%/bin;D:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;D:\Program Files\Microsoft SQL Server\100\Tools\Binn\;D:\Program Files\Microsoft SQL Server\100\DTS\Binn\;D:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\;D:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;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 Files\Java\apache-tomcat-7.0.28\webapps\docs Jul 06, 2012 8:32:26 PM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory D:\Program Files\Java\apache-tomcat-7.0.28\webapps\examples 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 Files\Java\apache-tomcat-7.0.28\webapps\host-manager Jul 06, 2012 8:32:26 PM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory D:\Program Files\Java\apache-tomcat-7.0.28\webapps\manager Jul 06, 2012 8:32:26 PM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory D:\Program Files\Java\apache-tomcat-7.0.28\webapps\ROOT 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.

like image 901
Orlan Avatar asked Jul 07 '12 00:07

Orlan


People also ask

Why isn't my Tomcat server is not starting?

Finding cause. Most common issue with Tomcat note starting is that Java is not configured properly, user trying to start Tomcat does not have permissions to do so, or another program is using port 8080 on that server.

What is Tomcat timeout?

The default value is 60000 (i.e. 60 seconds) but note that the standard server. xml that ships with Tomcat sets this to 20000 (i.e. 20 seconds). Unless disableUploadTimeout is set to false , this timeout will also be used when reading the request body (if any).


2 Answers

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.

like image 155
ekuusela Avatar answered Sep 21 '22 19:09

ekuusela


I've found that this can happen due to invalid/corrupted/??? breakpoints in your code when you start in "Debug". It is often accompanied by slow start up times.

"Remove All Breakpoints" cleared this up for me.

like image 41
BigOnionTechnologies Avatar answered Sep 22 '22 19:09

BigOnionTechnologies