Tomcat in Eclipse: It runs but time out during startup anyway

后端 未结 7 1924
终归单人心
终归单人心 2020-12-31 20:19

I\'m running a java web app in Eclipse (Helios) using Tomcat 7. The server startups up successfully (duration indicated) however Eclipse\'s progress bar still spins saying t

7条回答
  •  有刺的猬
    2020-12-31 20:51

    Some updates of Java cause problems with Eclipse's networking operation. Specifically, Eclipse tries to use IPv6 instead of IPv4 and sometimes fails. When Eclipse starts up Tomcat, one of the final steps that it does is tests the a debug call to Tomcat. This is likely to be the part that is hanging. Fortunately, the fix is very easy. We simply tell Eclipse to use IPv4 instead.

    To do this, edit the eclipse.ini file (found in the Eclipse directory) and add the following to the end of the file on its own line:

    -Djava.net.preferIPv4Stack=true
    

    Restart Eclipse and you should be good to go.

提交回复
热议问题