Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 751
komal Avatar asked Feb 17 '10 11:02

komal


People also ask

How do I access Tomcat on localhost?

Use a browser to check whether Tomcat is running on URL http://localhost:8080 , where 8080 is the Tomcat port specified in conf/server. xml. If Tomcat is running properly and you specified the correct port, the browser displays the Tomcat homepage.

How do I change Tomcat settings in Eclipse?

For configuring the tomcat server in eclipse IDE, click on servers tab at the bottom side of the IDE -> right click on blank area -> New -> Servers -> choose tomcat then its version -> next -> click on Browse button -> select the apache tomcat root folder previous to bin -> next -> addAll -> Finish.

Can we change Tomcat admin port in eclipse?

Open Eclipse Get Server view form Window -> Show View -> Servers Then double click the tomcat server Configuration window open and you can change the ports there.

How do I associate Tomcat with Eclipse?

Installing server runtimeStart the Eclipse WTP workbench. Open Window -> Preferences -> Server -> Installed Runtimes to create a Tomcat installed runtime. Click on Add... to open the New Server Runtime dialog, then select your runtime under Apache (Apache Tomcat v5. 0 in this example):


2 Answers

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.

like image 161
BalusC Avatar answered Oct 15 '22 16:10

BalusC


Eclipse hooks Dynamic Web projects into tomcat and maintains it's own configuration but does not deploy the standard tomcat ROOT.war. As http://localhost:8085/ link returns 404 does indeed show that tomcat is up and running, just can't find a web app deployed to root.

By default, any deployed dynamic web projects use their project name as context root, so you should see http://localhost:8085/yourprojectname working properly, but check the Servers tab first to ensure that your web project has actually been deployed.

Hope that helps.

like image 44
beny23 Avatar answered Oct 15 '22 17:10

beny23