Hi,
 
I'm trying to get a Cactus servlet up and running under JBoss 2.4.1 (running Tomcat 3.2.x). I've upgraded all my jars and classpaths to Cactus 1.2. I've got no compilation problems referring to "commons" packages, and I'm getting no ClassDefError exceptions. i.e. no obvious class loading problems.
 
When I set the cactus.servletRedirectorURL = http://localhost:8080/servc/ServletRedirector/ 
I get the following client-side error:
 
    [junit] http://localhost:8080/servc/ServletRedirector/
    [junit] java.io.FileNotFoundException: http://localhost:8080/servc/ServletRedirector/
    [junit]     at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:562)
 
Server returned HTTP response code: 404 for URL http://localhost:8080/servc/ServletRedirector/:
 
    [EmbeddedTomcatSX] 2001-09-26 10:00:33 - Ctx( /servc ): 404 R( /servc + /ServletRedirector/ + null) null

My servc.war web.xml looks like this (extract):
 
<=====================================================================>
 <servlet>
  <servlet-name>ServletRedirector</servlet-name>
  <servlet-class>org.apache.commons.cactus.server.ServletTestRedirector</servlet-class>
 </servlet>
 <servlet-mapping>
  <servlet-name>ServletRedirector</servlet-name>
  <url-pattern>/ServletRedirector/</url-pattern>
 </servlet-mapping>

 <servlet>
  <servlet-name>FrontController</servlet-name>
  <servlet-class>uk.co.servsoft.servc.web.FrontController</servlet-class>
  <load-on-startup>0</load-on-startup>
 </servlet> 
 <servlet-mapping>
  <servlet-name>FrontController</servlet-name>
  <url-pattern>/Main/*</url-pattern>
 </servlet-mapping>
<=====================================================================>
 
My test methods looks like this:
 
    public void beginCreateAccount(ServletTestRequest theRequest) {
        theRequest.addParameter("account.name","Tesco");
        theRequest.addParameter("account.reference-no","123456789");
        theRequest.addParameter("account.type","Corporate");
        theRequest.addParameter("account.status","Active");
    }
 
    public void testCreateAccount() {
        System.out.println("Running create account test...");
 
        try {
         // Some object instantiation and prep
         FrontController fcServlet = new FrontController();
         fcServlet.init(config);
 
            for(java.util.Enumeration e=request.getParameterNames(); e.hasMoreElements(); ) {
                String paramName = (String)e.nextElement();
                System.out.println(paramName);
            }
 
         // Let's call the servlet
           fcServlet.doPost(request,response);
        } catch (ServletException se) {
            System.err.println(se.getMessage());
            se.printStackTrace();
        } catch (IOException io) {
            System.err.println(io.getMessage());
            io.printStackTrace();
        }
    }
 
My cactus.properties file contains the following entry:
 
I know the /servc/ context works, because I can call other html and servlet resources in the same web application.
Does anyone have any ideas ? I couldn't find anything obvious in the lists archive.
 
Cheers,
Ijonas.

Reply via email to