Author: veithen Date: Sun Jan 9 13:47:01 2011 New Revision: 1056933 URL: http://svn.apache.org/viewvc?rev=1056933&view=rev Log: AXIS2-4898: Make sure that all threads created by commons-httpclient are properly shut down when AxisServlet is destroyed.
Modified: axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/AxisServlet.java Modified: axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/AxisServlet.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/AxisServlet.java?rev=1056933&r1=1056932&r2=1056933&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/AxisServlet.java (original) +++ axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/AxisServlet.java Sun Jan 9 13:47:01 2011 @@ -51,6 +51,7 @@ import org.apache.axis2.transport.http.u import org.apache.axis2.util.JavaUtils; import org.apache.axis2.util.MessageContextBuilder; import org.apache.axis2.util.OnDemandLogger; +import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager; import javax.servlet.ServletConfig; import javax.servlet.ServletContext; @@ -534,6 +535,10 @@ public class AxisServlet extends HttpSer } catch (Exception e) { log.info(e.getMessage()); } + // AXIS2-4898: MultiThreadedHttpConnectionManager starts a thread that is not stopped by the + // shutdown of the connection manager. If we want to avoid a resource leak, we need to call + // shutdownAll here. + MultiThreadedHttpConnectionManager.shutdownAll(); } /**