struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erikwe...@mindspring.com
Subject Re: The dreaded "Servlet action is not available"
Date Wed, 16 Nov 2005 14:41:04 GMT
Sorry, looks like you *did* do that. I didn't see it.

Erik


-----Original Message-----
From: erikweber@mindspring.com
Sent: Nov 16, 2005 9:39 AM
To: Struts Users Mailing List <user@struts.apache.org>
Subject: Re: The dreaded "Servlet action is not available"

On some older versions of Struts you had to declare the load-on-startup for the ActionServlet,
to make sure it was instantiated before any requests arrived. Not sure if that is the problem.

Erik


-----Original Message-----
From: Graham Leggett <minfrin@sharp.fm>
Sent: Nov 16, 2005 9:18 AM
To: user@struts.apache.org
Subject: The dreaded "Servlet action is not available"

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
--



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message