Return-Path: Delivered-To: apmail-axis-java-dev-archive@www.apache.org Received: (qmail 72961 invoked from network); 29 Nov 2010 12:06:05 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 29 Nov 2010 12:06:05 -0000 Received: (qmail 6360 invoked by uid 500); 29 Nov 2010 12:06:04 -0000 Delivered-To: apmail-axis-java-dev-archive@axis.apache.org Received: (qmail 6179 invoked by uid 500); 29 Nov 2010 12:06:02 -0000 Mailing-List: contact java-dev-help@axis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@axis.apache.org Delivered-To: mailing list java-dev@axis.apache.org Received: (qmail 6171 invoked by uid 99); 29 Nov 2010 12:06:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Nov 2010 12:06:02 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Nov 2010 12:06:01 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id oATC5flT018443 for ; Mon, 29 Nov 2010 12:05:41 GMT Message-ID: <23034814.15321291032341138.JavaMail.jira@thor> Date: Mon, 29 Nov 2010 07:05:41 -0500 (EST) From: "Chris Emerson (JIRA)" To: java-dev@axis.apache.org Subject: [jira] Commented: (AXIS2-4898) Thread named [MultiThreadedHttpConnectionManager cleanup] not cleaned up properly In-Reply-To: <21825103.329241290814994188.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/AXIS2-4898?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12964714#action_12964714 ] Chris Emerson commented on AXIS2-4898: -------------------------------------- Hi Andreas, I'm not sure how I can do what you're looking for. The problem does not appear until I make a call to the client stub. For instance ... EmployeeServiceSMARTStub.GetPerson req = new EmployeeServiceSMARTStub.GetPerson(); req.setPassword(password); req.setUsername(username); EmployeeServiceSMARTStub.GetPersonResponse res = employeeStub.getPerson(req); personStructs = res.get_return(); If I comment out the GetPersonResponse line, the MultiThreadedHttpConnectionManager is never started. I'm trying to think of a good way to get you a testcase. > Thread named [MultiThreadedHttpConnectionManager cleanup] not cleaned up properly > --------------------------------------------------------------------------------- > > Key: AXIS2-4898 > URL: https://issues.apache.org/jira/browse/AXIS2-4898 > Project: Axis2 > Issue Type: Bug > Components: client-api > Affects Versions: 1.5.1 > Environment: Operating system Windows and Linux > Application Server: Tomcat 6.0.29 > Axis2 version 1.5.1 > Client created with ADB > Reporter: Chris Emerson > Priority: Critical > > Shutting down Tomcat 6.0.29 gives the following error: > Nov 23, 2010 4:42:18 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads > SEVERE: A web application appears to have started a thread named [MultiThreadedHttpConnectionManager cleanup] but has failed to stop it. This is very likely to create a memory leak. > This error only happens when one of our Axis2 web services is called through a generated ADB client stub. It appears to never close this thread. > Our current configuration on the web application: > /** > * The configureServiceStub method sets the web service client settings and > * for the web service call. > * > * @param params WebServiceParameters > * > * @throws Exception > */ > private void configureServiceStub(WebServiceParameters params) throws Exception > { > // check if connection manager already established > if(connectionManager == null) > { > connectionManager = new MultiThreadedHttpConnectionManager(); > connectionManagerParams = new HttpConnectionManagerParams(); > connectionManagerParams.setDefaultMaxConnectionsPerHost(2); > connectionManagerParams.setTcpNoDelay(true); > connectionManagerParams.setStaleCheckingEnabled(true); > connectionManagerParams.setLinger(0); > connectionManager.setParams(connectionManagerParams); > httpClient = new HttpClient(connectionManager); > > configcontext = ConfigurationContextFactory.createDefaultConfigurationContext(); > configcontext.setThreadPool(new ThreadPool(1, 3)); > configcontext.setProperty(HTTPConstants.REUSE_HTTP_CLIENT, > Boolean.TRUE); > configcontext.setProperty(HTTPConstants.CACHED_HTTP_CLIENT, httpClient); > configcontext.setProperty(HTTPConstants.AUTO_RELEASE_CONNECTION, httpClient); > } > > if(employeeStub == null) > { > employeeStub = new EmployeeServiceSMARTStub(configcontext, > params.getLocalServiceUrl() > + "EmployeeServiceSMART.EmployeeServiceSMARTHttpSoap12Endpoint/"); > > employeeStub._getServiceClient().getOptions().setTimeOutInMilliSeconds(2 * 60 * 1000); > employeeStub._getServiceClient().getOptions().setProperty(HTTPConstants.SO_TIMEOUT, > 30000); > employeeStub._getServiceClient().getOptions().setProperty(HTTPConstants.CONNECTION_TIMEOUT, > 30000); > employeeStub._getServiceClient().getOptions().setProperty(HTTPConstants.REUSE_HTTP_CLIENT, > Boolean.TRUE); > employeeStub._getServiceClient().getOptions().setProperty(HTTPConstants.AUTO_RELEASE_CONNECTION, > Boolean.TRUE); > employeeStub._getServiceClient().getOptions().setProperty(HTTPConstants.CHUNKED, > Boolean.TRUE); > employeeStub._getServiceClient().getOptions().setCallTransportCleanup(true); > employeeStub._getServiceClient().getOptions().setProperty(HTTPConstants.HTTP_PROTOCOL_VERSION, > HTTPConstants.HEADER_PROTOCOL_10); > } > } > After each call we call the following code: > finally > { > // clean up all hanging threads and stop connection manager > if(employeeStub._getServiceClient() != null) > { > try > { > employeeStub._getServiceClient().cleanupTransport(); > } > catch(Exception e) > { > e.printStackTrace(); > } > try > { > employeeStub._getServiceClient().cleanup(); > employeeStub.cleanup(); > } > catch(Exception e) > { > e.printStackTrace(); > } > } > > connectionManager.closeIdleConnections(0); > connectionManager.shutdown(); > connectionManager = null; > employeeStub = null; > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org For additional commands, e-mail: java-dev-help@axis.apache.org