If I were doing it I would put a singleton class in the /common/lib/ that had a Hashtable and in my application's startup I would get the singleton and have the first application I want to load put a string "loading" (or whatever) in the Hashtable of the singleton with the key "webappY". The second webappX get the singleton and look for "webappY"/"loading". If it is still there sleep and check again later. When webappY is finished starting it removes the 'loading' from the Hashtable of the singleton and when "webappX" sees it is gone, it continues.
Michael Oliver CTO Alarius Systems LLC 6800 E. Lake Mead Blvd, #1096 Las Vegas, NV 89156 Phone:(702)643-7425 Fax:(702)974-0341 *Note new email changed from [EMAIL PROTECTED] -----Original Message----- From: Annie Wang [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 11, 2005 3:47 PM To: Parsons Technical Services; Tomcat Users List Subject: Re: question about load-on-startup in web.xml i tried putting in a sleep in my servlet's init method, but $CATALINA_HOME/logs/catalina.out seems to indicate that tomcat waits for it to initalize.. in my catalina.out, i have: May 11, 2005 2:12:06 PM org.apache.catalina.core.StandardHostDeployer install INFO: Installing web application at context path /webappX from URL file:/jakarta-tomcat/webapps/webappX ***webappX***start init ***webappX***end init May 11, 2005 2:12:06 PM org.apache.catalina.core.StandardHostDeployer install INFO: Installing web application at context path /webappY from URL file:/jakarta-tomcat/webapps/webappY any one know if there's a way to make webappY get installed before webappX? what determines the install order? i thought it was load-on-startup in the web.xml file, but maybe that affects the ordering of servlet initalization within a web application (if the web application has multiple servlets), but not the ordering of web application installation on tomcat startup. thanks. -annie On 5/10/05, Annie Wang <[EMAIL PROTECTED]> wrote: > hi doug, yup, was thinking along similar lines. just wasn't sure if > there was some setting i wasn't aware of to do what i'm looking for. > > thanks. > -annie > > On 5/10/05, Parsons Technical Services <[EMAIL PROTECTED]> wrote: > > I may be off base on this one but I think that once Tomcat fires off the > > init method it doesn't care or monitor the progress of the servlet. Just > > think, some servlets may take several minutes to finish. If other apps had > > to wait then it could take a long time to get the server started. > > > > Now as for a solution I am really speculating here (hopefully someone can > > educate both of us). I would look at a wait statement in the init method to > > pause the second app's servlet until the first one is done. Simply time the > > first app's servlet and set it for a little more. > > > > Hopefully someone will set me straight if I am off base here. > > > > Doug > > > > ----- Original Message ----- > > From: "Annie Wang" <[EMAIL PROTECTED]> > > To: <tomcat-user@jakarta.apache.org> > > Sent: Tuesday, May 10, 2005 6:59 PM > > Subject: question about load-on-startup in web.xml > > > > hi, > > > > regarding the <load-on-startup> tag in web.xml: > > > > say i have 2 web apps (webapp1 and webapp2). if i configure webapp1's > > servlet to have <load-on-startup>1</load-on-startup> and webapp2's > > servlet to have <load-on-startup>100</load-on-startup>, does this mean > > that tomcat will init webapp1's servlet first and once that's done, > > it'll init webapp2's servlet? > > > > basically, i want both web app's servlets to auto initialize on tomcat > > startup, but i want webapp2's servlet to initialze only after > > webapp1's servlet has finished initialization. when i use the above > > load-on-startup settings, webapp2's servlet seems to initialize before > > webapp1's servlet has finished initialization. > > > > thanks. > > -annie > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]