GeeCON Prague 2014*
The moose likes JBoss/WildFly and the fly likes HTTP Status 404 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "HTTP Status 404" Watch "HTTP Status 404" New topic
Author

HTTP Status 404

Alex Webs
Greenhorn

Joined: Jun 13, 2011
Posts: 4

Hello, i want test my application with JBoss and i get error: HTTP Status 404.

my web.xml

<?xml version="1.0"encoding="UTF-8"?>
<web-appversion= "2.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<display-name>TestWeb</display-name>
<servlet>
<description>TestClient</description>
<display-name>TestClient</display-name>
<servlet-name>TestClient</servlet-name>
<servlet-class>servlets.TestClient</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>TestClient</servlet-name>
<url-pattern>/test</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>


my URL: http://localhost:8080/TestWeb/

how to solve this problem ?
James Sabre
Ranch Hand

Joined: Sep 07, 2004
Posts: 781

Since you have mapped your servlet to URL /test I would have expected you to use

http://localhost:8080/test


Retired horse trader.
 Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

Or perhaps http://localhost:8080/TestWeb/test?
James Sabre
Ranch Hand

Joined: Sep 07, 2004
Posts: 781

Paul Clapham wrote:Or perhaps http://localhost:8080/TestWeb/test?


Yep. Assuming that the war file is TestWeb.war (or the web directory is TestWeb) then you are right. My mistake.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10146
    
165

Actually, Alex has a welcome page configured (index.jsp) so he shouldn't really have to use the /test url-pattern to get past that 404. My guess is that Alex is using an incorrect context for the web application.

Alex, what's the name of the war file that you are deploying? Does it have a jboss-web.xml? If not, then the context should be the name of the war file (without the .war suffix). So if you are deploying blah.war, then you should be using http://localhost:8080/blah. Note that the display-name that you use in the web.xml has no role to play, when it comes to accessing the application.

[My Blog] [JavaRanch Journal]
Alex Webs
Greenhorn

Joined: Jun 13, 2011
Posts: 4

WAR file: "TestWeb.war", but i don't understand why this file is created in this directory "E:\jboss-6.0.0\server\default\tmp\vfs\"
i'm not using file "jboss-web.xml", but i have this file.
in directory: "E:\jboss-6.0.0\server\default\deploy" i have file "Test.ear"

Jaikiran Pai wrote:Actually, Alex has a welcome page configured (index.jsp) so he shouldn't really have to use the /test url-pattern to get past that 404. My guess is that Alex is using an incorrect context for the web application.

Alex, what's the name of the war file that you are deploying? Does it have a jboss-web.xml? If not, then the context should be the name of the war file (without the .war suffix). So if you are deploying blah.war, then you should be using http://localhost:8080/blah. Note that the display-name that you use in the web.xml has no role to play, when it comes to accessing the application.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10146
    
165

Please post the logs that you see on the server console when you deploy your application.

P.S: While posting those logs remember to wrap it in a code block by using the "Code" button in the message editor window.
Alex Webs
Greenhorn

Joined: Jun 13, 2011
Posts: 4

JBoss server log

Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10146
    
165

The deployment has failed and hence you aren't able to access the application. Are you packaging EJBs in your .war file? Please provide more details on what the app contains and how it's packaged.
Alex Webs
Greenhorn

Joined: Jun 13, 2011
Posts: 4

Project: Test
2 modules: EJB and Web
TestEJB -> New -> Interface -> HelloWorldLocal.java



TestEJB -> New -> Class -> HelloWorldBean.java



WebContent -> New -> JSP -> index.jsp



TestWeb -> New -> Servlet - > TestClient.java



TestWeb -> Properties -> Deployment Assembly, and check TestEJB.jar


Jaikiran Pai wrote:The deployment has failed and hence you aren't able to access the application. Are you packaging EJBs in your .war file? Please provide more details on what the app contains and how it's packaged.
 
GeeCON Prague 2014
 
subject: HTTP Status 404