[ 
https://issues.apache.org/jira/browse/AXIS2-4330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12780426#action_12780426
 ] 

Oleg Lyashko commented on AXIS2-4330:
-------------------------------------

Phil, Sai

> Right now for threads more than 2 we are encountering the following exception
> 19:41:57,785 INFO HTTPSender:202 - Unable to sendViaPost to 
> url[http://localhost:8085/axis2/services/PAWS]
> org.apache.commons.httpclient.ConnectionPoolTimeoutException: Timeout waiting 
> for connection

I had the same problem. It seems that the source of is 
defaultMaxConnectionsPerHost value in MultiThreadedHttpConnectionManager is 2. 
Workaround for me was to create own instance of 
MultiThreadedHttpConnectionManager and use it in service stab, something like 
in example below

    protected static void updateStub(org.apache.axis2.client.Stub stub, int 
maxTotal, int maxPerHost) {
        MultiThreadedHttpConnectionManager httpConnectionManager = new 
MultiThreadedHttpConnectionManager();
        HttpConnectionManagerParams params = httpConnectionManager.getParams();
        if (params == null) {
            params = new HttpConnectionManagerParams();
            httpConnectionManager.setParams(params);
        }
        params.setMaxTotalConnections(maxTotal);
        params.setDefaultMaxConnectionsPerHost(maxPerHost);
        HttpClient httpClient = new HttpClient(httpConnectionManager);
        ServiceClient serviceClient = stub._getServiceClient();
        ConfigurationContext context = 
serviceClient.getServiceContext().getConfigurationContext();
        context.setProperty(HTTPConstants.CACHED_HTTP_CLIENT, httpClient);
    }

Regards, Oleg


> axis2  client machine has many CLOSE_WAIT tcp
> ---------------------------------------------
>
>                 Key: AXIS2-4330
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4330
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: client-api
>    Affects Versions: 1.4.1
>         Environment: solaris
>            Reporter: jenny anderson
>             Fix For: 1.5.1
>
>         Attachments: TuxedoWebServiceStub.java
>
>
> My application is using axis2 web service. It  invokes web service thousand 
> times per second. We observed thousand CLOSE_WAIT connection after the 
> application is run for less than 10 hours.  I checked even I set 
> REUSE_HTTP_CLIENT to false, it still gets CLOSE_WAIT.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to