Tomcat Not Starting Through Eclipse (Timeout)

后端 未结 27 2373
终归单人心
终归单人心 2020-12-01 06:41

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

相关标签:
27条回答
  • 2020-12-01 07:06

    Make sure Tomcat is actually listening to 127.0.0.1 when host name is set to localhost.

    When starting the Tomcat server in Eclipse the log displays something like:

    10:07:23 INFO  main o.a.c.h.Http11NioProtocol Initializing ProtocolHandler ["http-nio-192.168.2.63-8080"]
    

    Your Tomcat server configuration "Host name" and HTTP/1.1 Port MUST resolve to the displayed IP address & HTTP port (in the given example IP 192.168.2.63 Port 8080)

    This fixed it with Eclipse 4.5 (Mars) & Tomcat 8

    0 讨论(0)
  • 2020-12-01 07:06

    I was facing same issue and followed most of the solutions provided but they didn't worked for me.

    One of my senior told me the reason for the problem. Previously I created a build for staging environment using mvn clean install -Pstaging, which created a WAR file in the target folder for staging environment. Now whenever I start tomcat it was using the setting from the target to connect to the staging database server and was unable to connect (getting stuck at preparing launch delegate).

    Fix: First run mvn clean install in the workspace directory and then in eclipse right click project -> Maven -> Update Project. Now run tomcat.

    0 讨论(0)
  • 2020-12-01 07:08

    For those of you trying to start heavy-loaded application, with a lot of INFO level logging to console. Be aware Eclipse console printer can be confused by amount of data to print and hang Eclipse for a long time, while server actually will be started and can be accessed via browser.

    This problem happened to me and took me quite a while to figure out what's happening. I'm running Eclipse Mars and Tomcat 7. In my case app was trying to print all singleton bean names to console, about several thousand bean names thus Eclipse was going crazy.

    org.springframework.beans.factory.support.DefaultListableBeanFactory#preInstantiateSingletons
    
        if (this.logger.isInfoEnabled()) {
           this.logger.info("Pre-instantiating singletons in " + this);
        }
    

    Give it a try, put the app logging level=ERROR. Hopefully this will help someone.

    0 讨论(0)
  • 2020-12-01 07:09

    I was able to fix this issue by doing the following:

    • Right-click on the Tomcat server (under the Eclipse Servers perspective)
    • Select Open - it should open up the xml editor
    • Look for the Timeouts section and increase the value to > 45s

    This works with Eclipse Helios / Tomcat 7

    0 讨论(0)
  • 2020-12-01 07:09

    Well, I tried all these options, I could not get my recent version of STS (Spring Tool Suite 3.7.1.201510041213-RELEASE) to figure out that Tomcat had started.

    I tried Tomcat 7.0.64, 8.0.26, 8.0.28. All with the same results. I did get vanilla Tomcat installs to work, so I figured it must a problem with my server.xml (or other file).

    So I went through line by line until the server view would stop picking up the started status. Long story short, setting the secure attribute (to any value, like false) on a Connector causes STS to assume that it's another SSL handler.

    For example:

    <Connector secure="false" executor="conPool" port="8080" redirectPort="8443" protocol="HTTP/1.1" />
    

    Will cause STS to freak out, while:

    <Connector executor="conPool" port="8080" redirectPort="8443" protocol="HTTP/1.1" />
    

    Works as intended.

    It looks like STS assumes that by merely having the secure attribute, regardless of value, it's an SSL handler. Older versions of STS don't seem to have this problem though. Someone has already filed a very similar bug.

    Also note that the server configuration pane shows:

    When the server.xml has the secure attribute on a non-SSL connector (and behavior is somewhat wonky), and:

    The normal ports listed when it is removed.

    0 讨论(0)
  • 2020-12-01 07:10

    I encountered the same problem. I did all this stuff.

    1. Added all the environment variables in system properties.
    2. Window -> Preferences -> General -> Network Connections turned Active Provider to Manual.
    3. Added -Djava.net.preferIPv4Stack=true after -vmargs in eclipse.ini file.
    4. Increased the timeout from 45 sec.
    5. Updated Eclipse.

    Hope this helps.. !!!

    0 讨论(0)
提交回复
热议问题