Howdy,
Depending on how you mess up your configuration, e.g. have autoDeploy
set to true and have an explicit <Context> element with the same docBase
but different path than your app directory, then tomcat may deploy your
application twice, thereby initializing and destroying everything
(listeners, filters, servlets, JNDI contexts, etc.) twice.  This is
legit behavior per your configuration.  Be very careful in how you
deploy your applications.

Yoav Shapira
Millennium ChemInformatics


>-----Original Message-----
>From: Scott, Sean [mailto:[EMAIL PROTECTED]
>Sent: Friday, March 07, 2003 2:34 PM
>To: 'Tomcat Users List'
>Subject: RE: How to listen for shutdown
>
>Hey Frank,
>
>I also thought that my ServletContextListener was being invoked 2
times,
>but
>in reality Tomcat was actually deploying me application 2 times. I
posted a
>question regarding this a while back and never resolved it. When I try
to
>set the context path to something other than the name of my .war file,
I
>end
>up with the app being deployed 2 times. Once at the name of the war,
and
>the
>other where I specified. You can verify if your app is deployed more
than
>once by looking at the manager app.
>
>-sean
>
>
>-----Original Message-----
>From: Frank Lawlor [mailto:[EMAIL PROTECTED]
>Sent: Friday, March 07, 2003 12:29 PM
>To: Tomcat
>Subject: Re: How to listen for shutdown
>
>
>I found the answer to my questions:
>
>
>
>Documentation on ServletContextListener:
>
>http://developer.java.sun.com/developer/technicalArticles/Servlets/serv
l
>etapi2.3/
>
>
>
>In order to ge the servlet invoked, you need a <listener> tag, e.g.,
>
>  <listener>
>
>      <listener-class>com.foo.ControllerServlet</listener-class>
>
>  </listener>
>
>
>
>The appearance that I was not getting time to do my cleanup was due to
a
>couple of things:
>
>
>
>  1) you need to be careful what you do since other threads, instances,
>etc. are in the
>     process of disappearing.
>
>
>
>  2) For some reason my shutdown methods (both contextDestroyed() and
>destroy())
>     were being called twice.  I think they were not completing
>operation on the second
>     call.  Adding a static variable to ignore the second call seems to
>have fixed things.
>
>
>
>
>
>  -- Frank
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to