users@jersey.java.net

[Jersey] Re: Proper shutdown / destroy when using com.sun.jersey.spi.container.servlet.ServletContainer

From: Joseph Mocker <jmocker_at_velti.com>
Date: Fri, 12 Apr 2013 01:27:11 +0000

This is an old thread but appears to cover the topic

http://jersey.576304.n2.nabble.com/Destroying-injected-context-at-the-end-of-resource-lifecycle-td2280004.html

--joe


[Velti]<http://www.velti.com> Joseph Mocker | Senior Software Architect
t +1.650.566.7033 m
e jmocker@velti.com @Mobclix<http://twitter.com/Mobclix>
[cid:sep1111683b7f]
The leading global technology provider of
mobile marketing and advertising solutions

<http://mwc.velti.com/meet-us>

On Apr 11, 2013, at 2:04 PM, "Matthew Hall" <mhall_at_mhcomputing.net<mailto:mhall_at_mhcomputing.net>> wrote:

Hello,

I am using com.sun.jersey.spi.container.servlet.ServletContainer to start my
application.

The application creates some resources which can leak inside of Tomcat
(ThreadLocals, etc.), and produce leak warnings from Tomcat.

If I were making a normal Servlet I could code up a destroy() method. But I'm
not sure how to do it in Jersey since I'm not a subclass of Jersey's
ServletContainer and it's going to load my resources with reflection.

What's the right way to handle this?

Thanks,
Matthew.




logo111110eb2d
(image/gif attachment: logo111110eb2d)

sep1111683b7f
(image/gif attachment: sep1111683b7f)