I package up a file, gg.war, as follows: (note, the same directory structure I have
running in Tomcat 5x with no problems)
MANIFEST.MF (in META-INF\ )
IsItWorking.class ( in WEB-INF\classes\ )
web.xml (in WEB-INF\ )
My web.xml appears as follows:
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<servlet-name>IsItWorking</servlet-name>
<servlet-class>IsItWorking</servlet-class>
<servlet-mapping>
<servlet-name>IsItWorking</servlet-name>
<url-pattern>/gg/servlets</url-pattern>
</servlet-mapping>
</web-app>
When I put this gg.war into my deployment directory, JBoss seems to correctly deploy it
as:
21:14:27,615 INFO [TomcatDeployer] deploy, ctxPath=/gg,
warUrl=.../tmp/deploy/tmp30484gg-exp.war/
(though, I do not see a directory called /gg anywhere where this thing should be unpacked
to!)
However, when I go to call this servlet:
http://localhost:8080/gg/servlets/IsItWorking
I get a 404 error (The requested resource (/gg/servlets/IsItWorking/IsItWorking) is not
available.)
Why can't see the results of this servlet, which works fine in Tomcat (I am using
JBoss 4.2.3.GA). My servlet source code is simply:
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Date;
import javax.servlet.*;
import javax.servlet.http.*;
public class IsItWorking extends HttpServlet
{
public void service(HttpServletRequest httpservletrequest, HttpServletResponse
httpservletresponse)
throws ServletException, IOException
{
httpservletresponse.setContentType("text/html");
PrintWriter printwriter = httpservletresponse.getWriter();
String s = getServletConfig().getServletContext().getServerInfo();
printwriter.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML
3.2//EN\"> Yes, It's working! <META NAME=\"Author\"
CONTENT=\"" + s + "\">" + "" + "<BODY
BGCOLOR=\"#FFFFFF\">" + " " + " <IMG " +
"ALT=\"[ Picture broken ? Access this from localhost ]\" " +
"SRC=\"/jserv/status?image\" BORDER=\"0\">" + "
<H1>" + "Yes, It's working!" + "</H1>" + "
<H2>Congratulations, " + s + " is working!</H2>" + "
<H3>[ local time is " + new Date() + " ]</H3>" + "
<FONT SIZE=\"-1\">Copyright (c) 1997-99" + " <A
HREF=\"http://java.apache.org/\">The Java Apache Project" + " All
rights reserved." + " " + "" + "");
}
public IsItWorking()
{
}
public static final String TITLE = "Yes, It's working!";
As stated, this works fine when installed on Tomcat (4 and 5) but for whatever reason, I
can;t make it fly in JBoss. Please help this newbie -- I've been at this for a few
hours and can;t seem to get past this. Thanks!
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4184610#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...