You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by "Mark.Abbott" <Ma...@openwave.com> on 2001/04/26 16:56:52 UTC

starting/stopping contexts in Tomcat 4

The ContextConfig.start and ContextConfig.stop methods in 
Tomcat 4b2 do not appear to be inverses of each other.
The start method causes children to be added to the context
during web.xml parsing, but the stop method does not remove
them.  Doesn't this mean that stopping and then restarting 
a running application will always generate exceptions as
ContextConfig.start tries to add already existing servlets
to the context?

    Mark



Re: starting/stopping contexts in Tomcat 4

Posted by "Mark.Abbott" <Ma...@openwave.com>.
Thanks, Craig.  This will greatly increase the usefulness
of the Manager servlet because it can then be used to cause
a reload of web.xml and the app classes by stopping and starting 
an app, which is far easier than having to redeploy the app or restart all
of Tomcat.  Something that needs to be done often during
app development when web.xml is being changed a lot.

      Cheers - Mark

"Craig R. McClanahan" wrote:
> 
> On Thu, 26 Apr 2001, Mark.Abbott wrote:
> 
> >
> > The ContextConfig.start and ContextConfig.stop methods in
> > Tomcat 4b2 do not appear to be inverses of each other.
> > The start method causes children to be added to the context
> > during web.xml parsing, but the stop method does not remove
> > them.  Doesn't this mean that stopping and then restarting
> > a running application will always generate exceptions as
> > ContextConfig.start tries to add already existing servlets
> > to the context?
> >
> >     Mark
> >
> >
> >
> 
> You're right ... they should be inverses.  I'll add that to my TODO list.
> 
> Fortunately, this doesn't affect auto-reload -- the Context itself is not
> actually stop()'d and re-start()'d in that case, so the ContextConfig
> methods are not re-executed.
> 
> It also doesn't affect manual redeployment of apps through the Manager
> servlet, because that causes a completely new Context to be created.
> 
> Craig



Re: starting/stopping contexts in Tomcat 4

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Thu, 26 Apr 2001, Mark.Abbott wrote:

> 
> The ContextConfig.start and ContextConfig.stop methods in 
> Tomcat 4b2 do not appear to be inverses of each other.
> The start method causes children to be added to the context
> during web.xml parsing, but the stop method does not remove
> them.  Doesn't this mean that stopping and then restarting 
> a running application will always generate exceptions as
> ContextConfig.start tries to add already existing servlets
> to the context?
> 
>     Mark
> 
> 
> 

You're right ... they should be inverses.  I'll add that to my TODO list.

Fortunately, this doesn't affect auto-reload -- the Context itself is not
actually stop()'d and re-start()'d in that case, so the ContextConfig
methods are not re-executed.

It also doesn't affect manual redeployment of apps through the Manager
servlet, because that causes a completely new Context to be created.

Craig