Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WildFly running, project deployed, but 404

Tags:

java

jsf

wildfly

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

like image 220
user2582318 Avatar asked Feb 03 '14 20:02

user2582318


People also ask

How do I deploy a project in WildFly?

Deploy an application But if you are running a standalone WildFly service, a simple way to deploy your application is to copy your application archive ( war/ear/jar ) into the $JBOSS_HOME/standalone/deployments directory in the server installation. The deployment-scanner subsystem detects the archive and deploys it.

Is WildFly an application server?

WildFly is a Java Enterprise Edition fully featured application server that provides all the necessary features to run a Java web application. WildFly is designed and maintained by Red Hat and was formally known as JBoss AS.

How does WildFly server work?

WildFly takes an aggressive approach to memory management and is based on pluggable subsystems that can be added or removed as needed. The quick boot of WildFly combined with the easy-to-use Arquillian framework allows for test driven development using the real environment your code will be running in.


2 Answers

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"

like image 183
jefmaus Avatar answered Oct 31 '22 02:10

jefmaus


Your application is avalibale at

http://localhost:8080/HelloWorld

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

like image 37
Tomaz Cerar Avatar answered Oct 31 '22 00:10

Tomaz Cerar