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
224 views
in Technique[技术] by (71.8m points)

Tomcat started in Eclipse but unable to connect to http://localhost:8085/

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 FilesJavajre6in;.;C:WINDOWSSunJavain;C:WINDOWSsystem32;C:WINDOWS;C:/Program Files/Java/jre6/bin/client;C:/Program Files/Java/jre6/bin;E:oracleproduct10.2.0client_1in;C:WINDOWSsystem32;C:WINDOWS;C:WINDOWSsystem32WBEM;C:Program FilesMicrosoft SQL Server80ToolsBINN;C:Program FilesCommon FilesTeleca Shared;C:Program FilesMicrosoft SQL Server90Toolsinn;E:Program FilesMicrosoft Visual Studio 8Common7IDEPrivateAssemblies;C:Program FilesMySQLMySQL Server 5.0in;E:komal-gohiloolsSubversionin;C:SunSDKin;e:instantrails
ubyin;c:program filesjavajdk1.6.0_11in;E:komal-gohiloolsapache-maven-2.2.1in;C:program filesjavajdk1.6.0_11in;E:komal-gohiloolsAntin;E:komal-gohiloolsapache-tomcat-5.5.17in;C:SunSDKlibj2ee.jar;E:komal-gohiloolsandroid-sdk-windows-1.6_r1ools;E:komal-gohiloolsScalain;E:komal-gohiloolspax-construct-1.4in
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:

HTTP Status 404 - /

type Status report

message /

description The requested resource (/) is not available.

Apache Tomcat/6.0.24

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?

Question&Answers:os

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

1 Reply

0 votes
by (71.8m points)

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. 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.

enter image description here

Note, when it is grayed out, read the section leading text! It literally says "Server must be published with no modules present to make changes". In other words, make sure that you've removed all modules via rightclick server and Add and remove... option, and then performed rightclick server and Publish.

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.


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

...