Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HTTP Status 404

 
Alex Webs
Greenhorn
Posts: 4
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 781
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since you have mapped your servlet to URL /test I would have expected you to use

http://localhost:8080/test
 
Paul Clapham
Sheriff
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or perhaps http://localhost:8080/TestWeb/test?
 
James Sabre
Ranch Hand
Posts: 781
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Alex Webs
Greenhorn
Posts: 4
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JBoss server log

 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic