title: WildFly returns 404 error while same Maven project works fine on TomEE
body: <p>I am trying to make Hello World web application using Eclipse and Java-ee 8, but i can not access .xhtml file, getting 404 error.</p>
  <p>It is Maven project.</p>
  <p>Before i deploy and run on server, which is WildFly 21.0.2, i do Maven -&gt; Update and Run as -&gt; Maven -&gt; Clean verify.</p>
  <p>The server is starting OK, because i can access it at localhost.</p>
  <p>Page i am trying to access is index.xhtml, which is in webapp folder next to WEB-INF folder.</p>
  <p>There is a similiar question: <a href="https://stackoverflow.com/questions/47394753/error-404-not-found-wildfly">Error 404 - Not Found Wildfly</a>, but restarting Eclipse did not help.</p>
  <p>Page is accessible when i deploy to Apache TomEE 8.0.5 web profile.</p>
  <p>When i deploy my java-ee-8 application to WildFly 21.0.2 server (also tried 19.1.0) i can not access xhtml page. I get 404 error code. When i deploy to Apache TomEE 8.0.5 web profile, page is accessible. Both servers are compatible with java-ee-8 and started successfully. No errors in console nor logs.</p>
  <p>No configuration were done to the servers, i just added them to Eclipse and started. Same project was deployed. Does anyone know where could be the problem? I want to deploy my app to WildFly, not TomEE.</p>
  <p>TomEE starting log, also with accessing the page: <a href="https://textuploader.com/185ql" rel="nofollow noreferrer">https://textuploader.com/185ql</a></p>
  <p>WildFly starting log (nothing in console when trying to access the page): <a href="https://textuploader.com/185qc" rel="nofollow noreferrer">https://textuploader.com/185qc</a></p>
  <p>project structure:</p>
  <p><a href="https://i.stack.imgur.com/MmIvd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4eFzI.png" alt="Project structure" /></a></p>
  <p>pom.xml:</p>
  <pre><code>&lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot;
      xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
      xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;vis&lt;/groupId&gt;
      &lt;artifactId&gt;eshop-web&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;packaging&gt;war&lt;/packaging&gt;
  
      &lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;maven.compiler.source&gt;1.8&lt;/maven.compiler.source&gt;
          &lt;maven.compiler.target&gt;1.8&lt;/maven.compiler.target&gt;
          &lt;failOnMissingWebXml&gt;false&lt;/failOnMissingWebXml&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax&lt;/groupId&gt;
              &lt;artifactId&gt;javaee-api&lt;/artifactId&gt;
              &lt;version&gt;8.0&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  &lt;/project&gt;
  </code></pre>
  <p>web.xml:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;web-app xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
      xmlns=&quot;http://java.sun.com/xml/ns/javaee&quot;
      xsi:schemaLocation=&quot;http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_4_0.xsd&quot;
      version=&quot;4.0&quot;&gt;
      &lt;display-name&gt;eshop-web&lt;/display-name&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
          &lt;servlet-class&gt;javax.faces.webapp.FacesServlet&lt;/servlet-class&gt;
          &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;*.xhtml&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  &lt;/web-app&gt;
  </code></pre>
  <p>index.xhtml:</p>
  <pre><code>&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
  &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;
      xmlns:c=&quot;http://java.sun.com/jsp/jstl/core&quot;
      xmlns:fn=&quot;http://java.sun.com/jsp/jstl/functions&quot;
      xmlns:h=&quot;http://java.sun.com/jsf/html&quot;&gt;
  &lt;head&gt;
  &lt;title&gt;Hello World&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body style=&quot;background-color: lightgrey;&quot;&gt;
      &lt;h2&gt;Hello World&lt;/h2&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>project facets:</p>
  <p><a href="https://i.stack.imgur.com/43SDr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/43SDr.png" alt="Project facets" /></a></p>
  <p>Url i am trying to access is this: http://localhost:8080/eshop-web/index.xhtml
  Also tried: http://localhost:8080/index.xhtml, http://localhost:8080/webapp/index.xhtml, but still the page can not be found. I think it might be project configuration bug.</p>