12

i cant understand why for the project it return 404 or cant connect to the host, since the wildfly start page open perfectly

My web.xml

<?xml version="1.0"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
 <display-name>HelloWorld</display-name>
 <!--
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
  </welcome-file-list>
-->
 <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>*.jsf</url-pattern>
 </servlet-mapping>
 <servlet-mapping>
  <servlet-name>Faces Servlet</servlet-name>
  <url-pattern>*.faces</url-pattern>
 </servlet-mapping>
  <servlet-mapping>
  <servlet-name>Faces Servlet</servlet-name>
  <url-pattern>*.xhtml</url-pattern>
 </servlet-mapping>
 <servlet-mapping>
  <servlet-name>Faces Servlet</servlet-name>
  <url-pattern>/faces/*</url-pattern>
 </servlet-mapping>
</web-app>

enter image description here

2 Answers 2

13

Your application is avalibale at

http://localhost:8080/HelloWorld

as you can see also in your log. entry "register web context: /HelloWorld"

1
  • 2
    grep -ri "registered web context" PATH_TO_WILDFLY/standalone/log/* Jun 22, 2016 at 7:27
5

If the answer of ctomc does not work, you need create a file jboss-web.xml in /webapp/WEB-INF directory, with the next content:

<?xml version="1.0" encoding="UTF-8"?>
<jboss-web version="13.0"
    xmlns="http://www.jboss.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/schema/jbossas/jboss-web_13_0.xsd">
    <context-root>/ContextProject</context-root>
</jboss-web>

remember to change the version of wildfly that you use, and specify the context in which your application runs "ContextProject"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.