Question

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>
Was it helpful?

Solution

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:

OTHER TIPS

  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
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top