12
votes

I downloaded Apache Tomcat 6.0.2 And created a new server in Eclipse

  1. New -> Server
  2. Select "Tomcat v6.0 Server", Next
  3. Tomcat Installation Directory -> Where I unzipped Apache Tomcat 6.0.2
  4. Finish

Then I start the server and go to http://localhost:8080/ to see if it works. And I get a 404 error.

I've already googled it and tried to find a solution. But none of those remedies seem to work.

Any thoughts on what the problem is?

10
Please check the logs to see what error message have been loggedPrabhu R
I suspect you mean 6.0.20, yes? Not that it probably makes a difference, but little things can confuse the issue.Stu Thompson

10 Answers

12
votes

From the top of my head, I thought Eclipse started the tomcat server without anything in it, i.e. no web applications. You have to 'run' or actually deploy something in that Eclipse Tomcat server so you won't get the 404s.

The fact that you do get 404 error messages indicates that Tomcat actually IS running. If you shut it down from Eclipse, you won't get those 404's anymore ;)

6
votes

If your wanting to see your Tomcat Server Homepage then you will need to specify the server path and deploy path. The default is set to Use workspace metadata (does not modify your Tomcat installation).

How to do it.

  1. Firstly open the Server's view in Eclipse. (Window >> Show View >> Servers).
  2. Double click on your Tomcat Server to open the Server Overview.
  3. Then set the Server Locations to Use Tomcat installation (takes control of Tomcat installation). Save the changes.
  4. Restart your Server and then go to localhost:8080. This should open the Apache Tomcat Homepage for your server.

Hope this helps!

5
votes

The error 404 appears when Tomcat can't find the localhost.ser file. In order to get rid of this follow these steps: 1) In Eclipse, right click on server --> Properties --> Click Switch Location --> Apply-->Ok (This will switch the [workspace metadata] location to the installed Tomcat location.) 2) Then go back to server, double click it. This will open Overview tab. Under this tab goto -->Server Location --> Select Use Tomcat Installation combo box.

Now close it, save it and try run your server and then rerun the URL.

3
votes

I agree to drvdijk.

Go to "Servers" window, then select your Tomcat instance. Double.click here you will see the "overview" window. Here you can click on "Open launch configuration" to see your Tomcat arguments ("Arguments" tab).

Look for the system property "-Dwtp.deploy". This directory is where your Tomcat is looking for installed web applications, i think you don't have ROOT.war application here. Isn't it? :-)

Hope this will help you

1
votes

see if below URL Helps to resolve the issue

http://www.youtube.com/watch?v=orctlc_F5Y0

0
votes

The problem is just as drvdijk mentioned, in order to run a webapp on tomcat from eclipse, it needs to be "deployed" to it. This can be done by right clicking the tomcat server -> add and remove

Alternatively, you can try to startup your tomcat server outside of eclipse. Go to your command line and type

  $CATALINA_HOME\bin\startup.bat          (Windows)

  $CATALINA_HOME/bin/startup.sh           (Unix)

Where $catalina_home is the directory of where you installed tomcat

0
votes

Launch your eclipse Run as administration:
For that right click on eclipse-----> run as administration.
It works.

If it not works then again do same and then follow these steps:

  1. In Eclipse, right click on server --> Properties --> Click Switch Location --> Apply-->Ok
    (This will switch the [workspace metadata] location to the installed Tomcat location.)

  2. Then go back to server, double click it. This will open Overview tab. Under this tab goto -->Server Location --> Select Use Tomcat Installation combo box.

Now close it, save it and try run your server and then rerun the URL.

0
votes

1- double click on server 2- Make Sure You have switched correctly the directory for tomcat here

Before

enter image description here

After Fix enter image description here

3- And Even if you do #2 above you may need do this here as well !

Again here !

enter image description here

0
votes

Also, notice if you have a duplicated WEB-INF in your path. Sometimes after update a maven project you may have this issue and Tomcat points to an empty folder.