HTTP Status 404 - The requested resource (/ProjectName/) is not available
Asked Answered
L

3

6

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>
Lindesnes answered 17/10, 2011 at 20:7 Comment(2)
Status 404 means page not found. Page you are calling is not exist.Fenton
What page are you getting the 404 on?Bladdernut
S
13

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:

Seedtime answered 17/10, 2011 at 20:12 Comment(0)
H
0
  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
Hewitt answered 6/10, 2016 at 19:10 Comment(0)
W
0

To those who are still facing this issue.I was using Eclipse and I had all the configuration ok the only change that i did was to change the name fo the folder webapp to WebContent.

I had generated my project using the eclipse dynamic web application option.

Project ->src ->main -> Webcontent (instead of webapp , Java folder will also be there inside main)

Note:- this for eclipse project structure

Whimsy answered 2/11, 2021 at 10:15 Comment(1)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Belsen

© 2022 - 2024 — McMap. All rights reserved.