tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: Tomcat 4.0.3 hangs when removing web application.
Date Mon, 15 Apr 2002 11:42:17 GMT


On Mon, 15 Apr 2002, Daniel Aborg wrote:

> Date: Mon, 15 Apr 2002 11:45:08 +0100
> From: Daniel Aborg <daniel.aborg@netengines.com>
> Reply-To: Tomcat Users List <tomcat-user@jakarta.apache.org>
> To: Tomcat Users List <tomcat-user@jakarta.apache.org>
> Subject: Re: Tomcat 4.0.3 hangs when removing web application.
>
> Daniel Aborg wrote:
> > I'm trying to upgrade to JBoss 2.4 with Tomcat 4. Unfortunately, I've
> > encountered a rather fatal problem: When Tomcat is asked to remove our
> > web application, i.e. for redeploying it or when shutting down, it hangs
> > with the following message:
> >
> > StandardWrapper[/<context>:<servlet>]: Waiting for 1 instance(s) to
be
> > deallocated
>
> Here is a simple example which reproduces this behaviour:
>

No, this should not work -- and Tomcat 3.2 was broken in allowing it.

Per the servlet spec, the container is not allowed to call destroy() if
any requests are currently active.  Because you have a wait() in your
doGet() method, that request will not have returned yet -- hence, Tomcat
will wait (forever) for that request to be completed before calling
destroy().

Craig McClanahan


> --------------->8---------------
> import javax.servlet.http.HttpServlet;
> import javax.servlet.http.HttpServletRequest;
> import javax.servlet.http.HttpServletResponse;
>
> public class TestServlet extends HttpServlet
> {
> 	public void destroy()
> 	{
> 		System.out.println("destroy()");
>
> 		synchronized (this)
> 		{
> 			notifyAll();
> 		}
> 	}
>
> 	public void doGet(HttpServletRequest request, HttpServletResponse response)
> 	{
> 		System.out.println("doGet()");
>
> 		synchronized (this)
> 		{
> 			try
> 			{
> 				wait();
> 			}
> 			catch (InterruptedException iex) {}
> 		}
> 	}
> }
> --------------->8---------------
>
> In my eyes, this should work without any problems. (It does work just
> fine in Tomcat 3.2.2.)
>
> Thanks!
>
> /D
>
> --
> Daniel Aborg - Developer
>
>
> --
> To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
> Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>
>
>


--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message