Get HTTP Status 404 - Not Found, when the name of a dynamic web project renamed and deployed on Glassfish with Eclipse

Shadyar :

When I rename the name of a dynamic web project with JSF v2.2 as configuration created by itself Eclipse 2019.03 then I redeploy it on glassfish v5.1 with Eclipse, gets HTTP Status 404 - Not Found... While it was working well before renaming project name.


web.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0">
  <display-name>test1</display-name>
  <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
  </servlet-mapping>
  <welcome-file-list>
    <welcome-file>index.xhtml</welcome-file>
  </welcome-file-list>
</web-app>  


There is a simple index.xhtml in /WebContent

Shadyar :

I noticed when a new dynamic web project with JSF as configuration has been created by itself Eclipse, if you use Glassfish as server, there will be an additional file named glassfish-web.xml in /WebContent/WEB-INFO directory.
When the name of a dynamic web project is renamed, the line below of glassfissh-web.xml file should be modified manually to new name of the project:

<context-root>/testProject</context-root>

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Maven web project HTTP Status [404] – [Not Found]

Eclipse & Tomcat Error: HTTP Status 404 – Not Found:

HTTP Status 404 Not Found For Jersey REST application with Eclipse and Payara server

Failed to load resource: the server responded with a status of 404 (Not Found) in React.js Project deployed

Why I got HTTP 404 error when I run my dynamic web project?

HTTP Status 404 - on Eclipse with Tomcat (with no generated web.xml)

404 JSP file not found Dynamic Web Module imported project

Spring Mvc get HTTP Status [404] – [Not Found] after the submission

Spring Mvc App get - HTTP Status [404] – [Not Found]

HTTP Status 404 - Servlet not found

Servlet: HTTP Status 404 - Not Found

Usin dynamic web project Http 404 Resource is not available but no error in console

404 Not found when MVC application deployed

Maven Dynamic Web Project: My war is deployed with the version in its name. How to change it?

HTTP status 400 when trying to add web service reference to a project

`Not Found (HTTP 404)` error when using `genius` package to get lyrics

project not geting deployed in glassfish server

HTTP 404 status code (Not Found) shown as 302

HTTP Status 404 – Not Found Spring Boot

HTTP Status 404 – Not Found tomcat spring

HTTP Status [404] ? [Not Found] for /login in spring security

HTTP Status 404 – Not Found on Tomcat server

JSP/JDBC: HTTP Status 404 - Not Found

HTTP Status 404 - Not Found - Servlet and JSP

When call google script web app url from deployed company's project get java.io.IOException: Server returned HTTP response code: 403 for URL:

Response for preflight has invalid http status code 404 in my angular project while consuming web api

when trying to run struts2 with eclipse juno server,getting HTTP Status 404 error

HTTP Status 404 – Not Found: for controller - no view resolvers found in Idea

HTTP ERROR 404 accessing "name" Not Found (Servlet)