users@glassfish.java.net

Load on start up servlet initializing two times

From: <glassfish_at_javadesktop.org>
Date: Wed, 17 Jun 2009 23:26:24 PDT

Hi,

I have one problem in glassfish while i am specifying the load on start up servlet; it is initializing two times.

ie:Print statement in the init method of the servlet is executing two times.

I need to look up all the ejb's while the server startup itself instead of waiting for a request to the server.



My web.xml configuration is
 <servlet>
    <servlet-name>BootStrap</servlet-name>
    <servlet-class>com.path.dcrms.login.BootStrap</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>

and my servlet is


public class BootStrap extends HttpServlet{
        public void init(ServletConfig config){
                try {
                        ELogger.log("Server is going to initialize all system prerequisites", DcrmsConstants.SEVERE);
                        
                        ELogger.log("Server is ready to process requests at"+new Date(), DcrmsConstants.SEVERE);
                }
                catch (Exception ex) {
                        ex.printStackTrace();
                        System.out.println("Boot Strap failed"+ex);
                }

        }

}



I am using struts1.3.8+Hibernate with glass fish.

If anybody has any idea plz help me..

Thanks in advance

Crazy.
[Message sent by forum member 'anishpissac' (anishpissac)]

http://forums.java.net/jive/thread.jspa?messageID=351755