Tomcat在Eclipse中启动但无法连接到http

Tomcat在Eclipse中启动但无法连接到http

本文介绍了Tomcat在Eclipse中启动但无法连接到http:// localhost:8085 /的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  2010年2月17日,我在Tomcat 6.0.24中配置了Tomcat 6.0.24, 4:24:31 PM org.apache.catalina.core.AprLifecycleListener init 
INFO:基于APR的Apache Tomcat Native库,在生产环境中允许最佳性能在java.library.path中找不到:C:\\ \\ Program Files\Java\jre6\bin;。; C:\WINDOWS\Sun\Java\bin; C:\WINDOWS\system32; C:\WINDOWS; C:/ Program Files / Java / jre6 / bin / client; C:/ Program Files / Java / jre6 / bin; E:\oracle\product\10.2.0\client_1\bin; C:\WINDOWS\system32; C:\WINDOWS; C:\WINDOWS\system32\WBEM; C:\Program Files\Microsoft SQL Server\80\Tools\BINN; C:\Program Files\Common Files\\ \\ Teleca Shared; C:\Program Files\Microsoft SQL Server\90\Tools\binn\; E:\Program Files\Microsoft Visual Studio 8\Common7 \\IDE\PrivateAssemblies\; C:\Program Files\MySQL\MySQL Server 5.0\bin; E:\komal-gohil\tools\Subversion\bin; C:\Sun\ SDK\bin; e:\instantrails\ruby\bin; c:\program files\java\jdk1.6.0_11\bin; E:\komal-gohil\tools\apache- maven-2.2.1\bin; C:\program files\java\jdk1.6.0_11\bin; E:\komal-gohil\tools\Ant\bin; E:\komal -gohil\tools\apache-Tomcat的5.5.17\bin; C:\Sun\SDK\lib\j2ee.jar; E:\komal-gohil\tools\android-SDK -windows-1.6_r1\tools; E:\komal-gohil\tools\Scala\bin; E:\komal-gohil\tools\pax-construct-1.4\bin
2010年2月17日4:24:31 PM org.apache.coyote.http11.Http11Protocol init
INFO:初始化http-8085上的Coyote HTTP / 1.1
2010年2月17日4:24:31 .apache.catalina.startup.Catalina加载
INFO:初始化处理在705毫秒
2010年2月17日4:24:32 PM org.apache.catalina.core.StandardService start
信息:启动服务Catalina
2010年2月17日4:24:32 PM org.apache。 catalina.core.StandardEngine start
INFO:启动Servlet引擎:Apache Tomcat / 6.0.24
2010年2月17日4:24:32 PM org.apache.coyote.http11.Http11Protocol start
信息:在http-8085上启动Coyote HTTP / 1.1
2010年2月17日4:24:32 PM org.apache.jk.common.ChannelSocket init
INFO:JK:ajp13侦听/0.0.0.0 :8010
2010年2月17日4:24:32 PM org.apache.jk.server.JkMain start
INFO:Jk running ID = 0 time = 0/31 config = null
Feb 17,2010 4:24:32 PM org.apache.catalina.startup.Catalina start
INFO:服务器启动在421 ms

但是当我尝试在webbrowser中打开 http:// localhost:8085 时,它给我以下错误:

当我在外面启动Tomcat Eclipse,那么我可以在webbrowser中打开 http:// localhost:8085



可能是什么原因为了这?我如何解决这个问题?

解决方案

你期待什么?默认的Tomcat主页?如果是这样,您需要配置Eclipse以从Tomcat进行控制。



双击服务器选项卡中的Tomcat服务器条目,您将得到服务器配置。在左侧列中,在服务器位置下,选择使用Tomcat安装(注意,当它变灰时, ))。这样,Eclipse将完全控制Tomcat,这样,当您从Eclipse中运行时,您也可以使用Tomcat Manager访问默认的Tomcat主页。我在开发使用Eclipse时看不到有用的。





端口号不是问题。否则在Tomcat的启动日志中会出现异常,浏览器会显示一个特定于浏览器的连接超时错误页面,因此不会出现Tomcat特定的错误页面,当Tomcat未启动并运行时,该错误页面可能无法提供。


I configured Tomcat 6.0.24 in Eclipse on port 8085 and started successfully with log as below:

Feb 17, 2010 4:24:31 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: C:\Program Files\Java\jre6\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jre6/bin/client;C:/Program Files/Java/jre6/bin;E:\oracle\product\10.2.0\client_1\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\WBEM;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\Program Files\Common Files\Teleca Shared;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;E:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\;C:\Program Files\MySQL\MySQL Server 5.0\bin;E:\komal-gohil\tools\Subversion\bin;C:\Sun\SDK\bin;e:\instantrails\ruby\bin;c:\program files\java\jdk1.6.0_11\bin;E:\komal-gohil\tools\apache-maven-2.2.1\bin;C:\program files\java\jdk1.6.0_11\bin;E:\komal-gohil\tools\Ant\bin;E:\komal-gohil\tools\apache-tomcat-5.5.17\bin;C:\Sun\SDK\lib\j2ee.jar;E:\komal-gohil\tools\android-sdk-windows-1.6_r1\tools;E:\komal-gohil\tools\Scala\bin;E:\komal-gohil\tools\pax-construct-1.4\bin
Feb 17, 2010 4:24:31 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8085
Feb 17, 2010 4:24:31 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 705 ms
Feb 17, 2010 4:24:32 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Feb 17, 2010 4:24:32 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.24
Feb 17, 2010 4:24:32 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8085
Feb 17, 2010 4:24:32 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8010
Feb 17, 2010 4:24:32 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/31  config=null
Feb 17, 2010 4:24:32 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 421 ms

But when I am trying to open http://localhost:8085 in webbrowser, it is giving me the following error:

When I start Tomcat outside the Eclipse, then I can just open http://localhost:8085 in webbrowser.

What could be the reason for this? How do I solve this problem?

解决方案

What are you expecting? The default Tomcat homepage? If so, you'll need to configure Eclipse to take control over from Tomcat.

Doubleclick the Tomcat server entry in the Servers tab, you'll get the server configuration. At the left column, under Server Locations, select Use Tomcat installation (note, when it is grayed out, read the section leading text! ;) ). This way Eclipse will take full control over Tomcat, this way you'll also be able to access the default Tomcat homepage with the Tomcat Manager when running from inside Eclipse. I only don't see how that's useful while developing using Eclipse.

The port number is not the problem. You would otherwise have gotten an exception in Tomcat's startup log, and the browser would show a browser-specific "Connection timed out" error page and thus not a Tomcat-specific error page which could impossibly be served when Tomcat was not up and running.

这篇关于Tomcat在Eclipse中启动但无法连接到http:// localhost:8085 /的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-14 00:24