You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by ECLIPSE + CVS <an...@gmail.com> on 2009/06/18 08:54:22 UTC

Load on startup servlet in glassfish initializing two times

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 Worker.
-- 
View this message in context: http://www.nabble.com/Load-on-startup-servlet-in-glassfish-initializing-two-times-tp24087392p24087392.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Load on startup servlet in glassfish initializing two times

Posted by Girish Naik <gi...@gmail.com>.
It seems your problem something similar to :
this<http://markmail.org/message/24bkiar4ylo57lab#query:servlet%20init%20getting%20called%20twice+page:1+mid:fcrgp2ny3nnu3ia6+state:results>and
not struts related as Newton (
[?] Dave Newton) mentioned.


Regards,
---------------------------------------------------------
Girish Naik
Mobile:-+91-09740091638
girish.naik@gmail.com
Fran Lebowitz<http://www.brainyquote.com/quotes/authors/f/fran_lebowitz.html>
- "Life is something to do when you can't get to sleep."

On Thu, Jun 18, 2009 at 5:09 PM, Dave Newton <ne...@yahoo.com> wrote:

> This doesn't appear to be a Struts issue.
>
>
> ECLIPSE + CVS wrote:
>
>> 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 Worker.
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Load on startup servlet in glassfish initializing two times

Posted by Dave Newton <ne...@yahoo.com>.
This doesn't appear to be a Struts issue.

ECLIPSE + CVS wrote:
> 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 Worker.

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