Hi, > -----Original Message----- > From: Daniel Drasin [mailto:[EMAIL PROTECTED]] > Sent: Friday, February 08, 2002 3:37 PM > To: Tomcat Users List > Subject: Tomcat + Apache lifecycle question > > > I've set up Tomcat 4.x to work with Apache 1.3.x using the > Warp connector stuff. I followed the standard instructions for > how to modify the httpd.conf file of apache, etc. (All pretty > straightforward...) My problem is that i need to have a certain > activity occur when Tomcat starts up. This activity is to initialize > a certain set of java objects and make them available to servlets. > Because of classpath issues (i.e. classloaders) i was unable to use > the lifecycle hooks of the contexts and had to settle for the > (hackish) method of making a dummy servlet that only exists to > have its <load-on-startup> value set (excerpt from the web.xml is > below). This servlet has an init() definition that initializes the > objects in question (example definition below.) > > The issue is that i need to have this activity occur once and only > once - so i add a static flag into the init method to see if it's > already run. However, this doesn't work. When i start tomcat, > the initialization code runs and when i start apache, it runs > again - despite the flag. (Output included below). > > My guess is that the flag doesn't help because these init() calls > are occuring in two different object spaces (class loaders) so the > flag really is false both times. > > So my question is - what's going on here. Fundamentally, how can > i achieve my goal outlined in paragraph 1. At a deeper level, my > question is - why do i get two calls to startup?
Well, AFAIK yes. But by default there are two Services. Standalone and Apache-Tomcat. So, you either have to choose one of them (since they're really different) or try to use JNDI for that purpose. > Is tomcat starting > a new context for apache? If so, why doesn't it use the one that > it's already started? Is there a way to surpress the starting of > one of the contexts? > > Any help is appreciated > > Dan Anton -- To unsubscribe: <mailto:[EMAIL PROTECTED]> For additional commands: <mailto:[EMAIL PROTECTED]> Troubles with the list: <mailto:[EMAIL PROTECTED]>