users@grizzly.java.net

Grizzly not calling destroy for servlet filters

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Fri, 27 Mar 2009 10:22:17 +0100

Hi,

When using Grizzly 1.9.8 and 1.9.9-SNAPSHOT i noticed when i set up
the GrizzlyWebServer to use a filter that the Filter.destroy method is
not called when i stop of the GrizzlyWebServer e.g.

         GrizzlyWebServer ws = new GrizzlyWebServer(port);

         ServletAdapter sa = new ServletAdapter();

         sa.addFilter(new MyFilter(), "filter", null);

         sa.setContextPath(baseUri.getRawPath());

         ws.addGrizzlyAdapter(sa, new String[] {""} );

         ws.start();

         // Do some stuff...

         ws.stop() // MyFilter.destroy() not called

Attached is a simple maven project that reproduces the issue. See the
filter.Main.MyFilter class, which should print something out on destroy.

Paul.