3 Replies Latest reply on Nov 24, 2010 9:19 PM by Born Free

    load on start up/ jboss 5.1

    Born Free Newbie

         I have deployed my war file in jboss 5.1 AS, I am using default configuration. It seems that even though I have mentioned in my web.xml <load-on-startup> 1 it doesn't seems to initilaize the servlet.

       


      Am I misisng something in my web.xml. Note that I am able to see my spring bean getting initilized(debug logs indicate this) but some how my servlet does seems to be loaded. Also app started with no error.

       

       

       

      Here is my web.xml file

        • 1. Re: load on start up/ jboss 5.1
          Born Free Newbie

          <?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>
            <context-param>
              <param-name>contextConfigLocation</param-name>
              <param-value>
                /WEB-INF/app-*.xml
                classpath*:META-INF/app-*.xml
                /WEB-INF/spring-jms.xml <!--  spring jms configuration information -->
              </param-value>
            </context-param>
          <context-param>
            <param-name>contextClass</param-name>
            <param-value> org.jboss.spring.vfs.context.VFSXmlWebApplicationContext</param-value>
          </context-param>
            <!-- compress content, if possible -->
            <filter>
            .......
            ......
            </filter>

           


            <filter-mapping>
            .......
            .......
            </filter-mapping>

           


            <listener>
             .......
            ......
            </listener>

           


            <servlet>
              <servlet-name>DefaultServletOverride</servlet-name>
              <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
              <init-param>
                  <param-name>listings</param-name>
                  <param-value>false</param-value>
              </init-param>
              <load-on-startup>1</load-on-startup>
            </servlet>
            <servlet>
              <servlet-name>action</servlet-name>
              <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
              <init-param>
                <param-name>application</param-name>
                <param-value>com.fuelquest.StrutsResources</param-value>
              </init-param>
              <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>2</param-value>
              </init-param>
              <load-on-startup>2</load-on-startup>
            </servlet>
            <servlet>
              <servlet-name>myServlet</servlet-name>
              <servlet-class>com.xxx.yyy.MyServlet</servlet-class>
              <load-on-startup>1</load-on-startup>
            </servlet>
             <servlet>
             .........
             .........
             </servlet>
             
            <servlet-mapping>
            .........
             .........
            </servlet-mapping>

           


            <mime-mapping>
              <extension>ico</extension>
              <mime-type>image/x-icon</mime-type>
            </mime-mapping>

            <taglib>
              <taglib-uri>/WEB-INF/core</taglib-uri>
              <taglib-location>/WEB-INF/c.tld</taglib-location>
            </taglib>
            <taglib>
            .........
               .........
            </taglib>
          </web-app>

          • 2. Re: load on start up/ jboss 5.1
            jaikiran pai Master

            I see you have two servlets with load-on-startup value = 1. From what I remember of the spec the order of loading the servlets in that case is undefined but such servlets are still loaded on startup. But can you change one of those servlets (preferably your application's) load-on-startup value to something else (like 2).

            • 3. Re: load on start up/ jboss 5.1
              Born Free Newbie

              Thanks JaiKiran,

              I kept only one servlet, there was some init() exception in one of the servlet, thanks for the response