Hi all,

I have been trying to set up a new Struts project from scratch, and having set up a basic action class, etc I fire off a browser at my URL, and I get the dreaded "Servlet action is not available" error.

As this message by itself is meaningless, I have been trying to hunt down the actual stacktrace in the tomcat logs to tell me what really happened, and here I have a problem: there are no tomcat logs, apparently tomcat v5.5 + eclipse + sysdeo plugin doesn't seem to work properly (logs go to /dev/null), still trying to debug this on the tomcat list.

What will simplify things enormously is if I can be certain this error message is a Struts message or a Tomcat message, so that I don't go on a long wild goose chase.

I am not sure whether the Struts servlet is even being called at all, as setting breakpoints within the struts ActionServlet class has no effect - the class never runs the init() method, nor the doGet() method. I also cannot find the text string "Servlet action is not available" in the Struts source code.

Here is my web.xml, can anyone see anything obviously wrong with it?

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd";>

<web-app>

  <!-- load the cactus test servlets -->
    <servlet>
     <servlet-name>ServletRedirector</servlet-name>
     <servlet-class>
       org.apache.cactus.server.ServletTestRedirector
     </servlet-class>
     <init-param>
       <param-name>param1</param-name>
       <param-value>value1 used for testing</param-value>
     </init-param>
     <load-on-startup>2</load-on-startup>
   </servlet>

   <servlet>
     <servlet-name>ServletTestRunner</servlet-name>
     <servlet-class>
       org.apache.cactus.server.runner.ServletTestRunner
     </servlet-class>
     <load-on-startup>3</load-on-startup>
   </servlet>

  <!-- load the struts controller servlet -->
   <servlet>
     <servlet-name>action</servlet-name>
     <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
       <init-param>
        <param-name>config</param-name>
        <param-value>/WEB-INF/struts-config.xml</param-value>
      </init-param>
     <init-param>
       <param-name>debug</param-name>
       <param-value>0</param-value>
     </init-param>
     <init-param>
       <param-name>detail</param-name>
       <param-value>3</param-value>
     </init-param>
     <load-on-startup>1</load-on-startup>
   </servlet>

  <servlet-mapping>
    <servlet-name>ServletRedirector</servlet-name>
    <url-pattern>/ServletRedirector</url-pattern>
  </servlet-mapping>

  <servlet-mapping>
    <servlet-name>ServletTestRunner</servlet-name>
    <url-pattern>/ServletTestRunner</url-pattern>
  </servlet-mapping>

  <servlet-mapping>
     <servlet-name>action</servlet-name>
     <url-pattern>*.do</url-pattern>
   </servlet-mapping>

  <taglib>
    <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
    <taglib-location>/WEB-INF/tlds/struts-bean.tld</taglib-location>
  </taglib>

  <taglib>
    <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
    <taglib-location>/WEB-INF/tlds/struts-html.tld</taglib-location>
  </taglib>

  <taglib>
    <taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
    <taglib-location>/WEB-INF/tlds/struts-logic.tld</taglib-location>
  </taglib>

  <taglib>
    <taglib-uri>/WEB-INF/struts-nested.tld</taglib-uri>
    <taglib-location>/WEB-INF/tlds/struts-nested.tld</taglib-location>
  </taglib>

  <taglib>
    <taglib-uri>/WEB-INF/struts-template.tld</taglib-uri>
    <taglib-location>/WEB-INF/tlds/struts-template.tld</taglib-location>
  </taglib>

  <taglib>
    <taglib-uri>/WEB-INF/struts-tiles.tld</taglib-uri>
    <taglib-location>/WEB-INF/tlds/struts-tiles.tld</taglib-location>
  </taglib>

</web-app>

Regards,
Graham
--

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to