5
votes

I'm getting the following error when running my Eclipse project on Tomcat server:

HTTP Status 404 - The requested resource (/ProjectName/) is not available.

The URL in browser's address bar is http://localhost:8080/ProjectName/.

I really don't know what is missing in my files. I have an Index.jsp in the /WebContent folder and my web.xml contains below entry:

<welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
</welcome-file-list>
2
Status 404 means page not found. Page you are calling is not exist.Vikas Naranje
What page are you getting the 404 on?Robert

2 Answers

12
votes

By default, when you open the project root folder as in http://localhost:8080/ProjectName/ instead of a physical file as in http://localhost:8080/ProjectName/Index.jsp, then the server will lookup for a welcome file in web.xml. If none is found, then you'll get this 404 "Page not found" error.

In your case, URLs and file names are case sensitive. You declared index.jsp to be the welcome file, but you mentioned that you've an Index.jsp. Rename it to index.jsp and then you'll be able to open the webapp's context root with the welcome file this way.

See also:

0
votes
  1. In the Project Explorer right click on test (which is the name of your project, if I got it right)
  2. In the context menu choose Export->WAR file
  3. In the dialog window that pops up click the Browse... button to choose the destination folder for the deployment. This should be the web application folder(webs) of your Tomcat installation: /webapps where is the folder you have installed Tomcat in.
  4. Click Finish
  5. Now start your Tomcat.Assuming you have the index.html file in the WebContent folder of the test project in Eclipse, you should see the content of index.html in your browser when you open the URL. http://localhost:8080/projectApplication