On Mon, 15 Apr 2002, Daniel Aborg wrote:

> Date: Mon, 15 Apr 2002 11:45:08 +0100
> From: Daniel Aborg <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: Tomcat Users List <[EMAIL PROTECTED]>
> 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:[EMAIL PROTECTED]>
> For additional commands: <mailto:[EMAIL PROTECTED]>
> Troubles with the list: <mailto:[EMAIL PROTECTED]>
>
>


--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to