users@glassfish.java.net

Re: Stumped by ServletContext and ServletContextListener behavior

From: Jan Luehe <Jan.Luehe_at_Sun.COM>
Date: Wed, 11 Mar 2009 13:15:17 -0700

On 03/11/09 01:02 PM, glassfish_at_javadesktop.org wrote:
> Hi guys,
>
> I am trying to create a service that our other servlets will use. Its supposed to set itself up on ContextInitialized and clean up on ContextDestroyed.
>
> My problem is that a key attribute I store in the ServletContext and need toa ccess for celanup is VANISHING from the attributes before ContextDestroyed get called :(
>
> I am *positive* I am not resetting it myself. Where is it going and why???
>
> This has been immensely frustrating to try to debug.
>
> The code is below if anyone wants to look at it
>

This was fixed in GlassFish v3_b29 as part of

  https://glassfish.dev.java.net/issues/show_bug.cgi?id=6442

  Invoke contextDestroyed() of ServletContextListener *before* clearing any
  context attributes.

HTH,

Jan