Ich habe eine einfache Hallo Welt Webapp, die, wenn ich es in Tomcat mit der URL http://localhost:8080/na/environment
läuft funktioniert gut; Derselbe Krieg in Wildfly 9 funktioniert nicht, ich bekomme einen 404 Fehler.WildFly 9 Deployment einfache webapp aber 404
Googeln ich fand ein WildFly-Projekt benötigt 2 Dateien (beans.xml und jboss-web.xml), ich habe nur zum Projekt hinzugefügt, funktioniert aber immer noch nicht.
Meine wildldFly Admin-Konsole sagt der Krieg eingesetzt und aktiviert
Das ist die Struktur meines Projekts:
Und der Inhalt meiner Datei jboss-web.xml
ist:
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web 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/j2ee/schema/jboss-web_5_1.xsd">
<context-root>/</context-root>
</jboss-web>
Die beans.xml
ist leer (immer noch nicht, was ist sein Schweinswal).
schließlich der Code meines Servlet (und nur Klasse) ist:
@WebServlet(urlPatterns="/environment")
public class Environment extends HttpServlet {
private static final long serialVersionUID = 1L;
protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException,
IOException {
response.getWriter().append("Hello");
}
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException,
IOException {
doGet(request, response);
}
}
ich versucht mit:
http://localhost:9990/na/environment/
http://localhost:9990/na.war/environment/
http://localhost:9990/environment/