You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Greg Hess <gh...@wrappedapps.com> on 2002/09/30 20:13:30 UTC

[BUG]Action Servlet not initialized in Resin

Hi All,

My application is intermittently being initialized improperly. I am
deploying multiple struts based app's into resin and am experiencing errors
with several Struts tags being used. The application deploys fine 9/10 times
and then blows up. When I inspect the logs I follow the initialization
sequence and see the error. Basically resin receives a request for a new
deployed web app and begins initializing it after all the <load-on-startup>
servlets have been initialized, then resin initializes a some of its
servlets for handling JSP requests and then processes the requested JSP
resource. When my bug appears and I follow the initialization sequence I can
see the problem. Resin initializes its servlet for handling JSP request and
then processes the requested JSP resource, then it initializes my load
sequence. So the requested JSP using Struts fails because Struts has not
been initialized yet. If I wasn't using struts it would just fail in another
class. I am sure this is a problem with resin and have read many! archives
in there database regarding initialization issues and some with Struts but
no resolution other than using the ServletContext<listener> witch will not
work form my Struts components.

I have not seen any related Struts archives and am wondering if anyone else
has had this problem and how it can be rectified?

I am running Resin 2.12 and have configured a struts app to be initialized
as follows in the web.xml.

<!-- Database Initialization Servlet Configuration -->
    <servlet>
        <servlet-name>initializer</servlet-name>

<servlet-class>com.wrappedapps.boutique.business.AppInitServlet</servlet-cla
ss>
            <init-param>
                <param-name>debug</param-name>
                <param-value>1</param-value>
            </init-param>
            <load-on-startup>1</load-on-startup>
    </servlet>

    <!-- Standard Action Servlet Configuration -->
    <servlet>
            <servlet-name>action</servlet-name>

<servlet-class>org.apache.struts.tiles.ActionComponentServlet</servlet-class
>
            <!-- Tiles definitions -->
            <init-param>
            <param-name>definitions-config</param-name>
            <param-value>/WEB-INF/tiles/tiles-defs.xml</param-value>
          </init-param>
            <!-- Default struts application -->
            <init-param>
                <param-name>config</param-name>
                <param-value>/WEB-INF/struts-config.xml</param-value>
            </init-param>
     <!-- Struts sub-application -->
     <init-param>
           <param-name>config/ownersguide</param-name>
           <param-value>/WEB-INF/struts-config-og.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>0</param-value>
            </init-param>
            <load-on-startup>3</load-on-startup>
    </servlet>

Many thanks,

Greg