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

Alois Reitbauer commented on AXIS2-3670:
----------------------------------------

Hi Michele,

I checked some of the other JIRA issues as well, However it did not really 
solve my problem. I also found two versions of using a cached HTTP client. One 
explcitly setting the CACHED_HTTP_CLIENT property and one not doing it. However 
I tried both ways and neither worked.

Below is the client code that you for your help in advance

        public static ServiceClient sender;
                
    static{             
                try {
                        sender = new ServiceClient ();
                        Options options = sender.getOptions ();
            options.setProperty(Constants.Configuration.ENABLE_REST, 
Constants.VALUE_TRUE);
            options.setProperty(Constants.Configuration.HTTP_METHOD, 
Constants.Configuration.HTTP_METHOD_GET);
            options.setProperty(HTTPConstants.HEADER_CONNECTION, 
HTTPConstants.HEADER_CONNECTION_KEEPALIVE);
 
//            once used once not - however no effect            
//            HttpClient httpClient = new HttpClient(new 
MultiThreadedHttpConnectionManager());
//            options.setProperty(HTTPConstants.CACHED_HTTP_CLIENT, 
httpClient);            
                        
            options.setProperty(HTTPConstants.REUSE_HTTP_CLIENT, 
Constants.VALUE_TRUE);
                        EndpointReference endPoint = new EndpointReference 
("http://localhost:8080/axis2/services/AddressService/getPersons";);
                        options.setTo(endPoint);                        
                } catch (AxisFault e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                }
        
        }
        public static void main(String[] args) throws AxisFault {
        Object o = new Object();
        for (int i = 0; i < 40000000; i++) {
                invokeAsRest();
            synchronized (o) {
                try {
                    o.wait(100);
                } catch (InterruptedException ex) {
                }
            }
        }
    }

      private static void invokeAsRest (){
        
        try {
                        QName op= new QName ("http:/webservices.test/xsd", 
"getPersons");
                        QName param = new QName ("http://webservices.test/xsd";, 
"count");
                        Object [] args = new Object[]{100};
                        OMElement request = BeanUtil.getOMElement(op, args, 
param, false, null);
                        OMElement response = sender.sendReceive(request);
                        System.out.println(response);
                } catch (AxisFault e) {
                        e.printStackTrace();
                }
        
    }

> Probell using REUSE_HTTP_CLIENT - Application stalls
> ----------------------------------------------------
>
>                 Key: AXIS2-3670
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3670
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>    Affects Versions: 1.3
>            Reporter: Alois Reitbauer
>            Priority: Blocker
>
> When using REUSE_HTTP_CLIENT on a service client to reuse a http client the 
> client application hangs after 3 executions. The reason is that it obviously 
> waits in MultithreadedHttpConnectionManager.getConnectionWithTimeout()

-- 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to