Hi Rajkumari,

so far I have not tried HttpClient 4.x on my own, but using a 
SingleClientConnManager doesn't sound to be a reasonable choice to support 
multiple threads. So what about using ThreadSaveClientConnManager instead? I 
suggest having a look at the pretty good JavaDoc!
Additional hint:While you are at you should also have a glance at 
setMaxForFoute() and setMaxTotalConnections() and adjust the probably 
RFC-compliant defaults according to your usage scenario.

Hope this helps.

Regards,
   Eric




> -----Original Message-----
> From: rajkumari [mailto:[email protected]]
> Sent: Friday, June 11, 2010 7:29 AM
> To: [email protected]
> Subject: same HttpClient object for multiple threads it is not working and
> causing the exception
> 
> 
>  Hi,,
> 
> I was using Httpclient 3.1 for http connetcion in my project.
> Now i have upgraded HttpClient 3.1 to Httpclient 4.0.1.
> 
> The problem which i am facing with HttpClient 4.0.1 is that when I use
> same
> HttpClient object for multiple threads it is not working and causing the
> exception .
> 
> "Invalid use of SingleClientConnManager: connection still allocated.
> Make sure to release the connection before allocating another one.Cause
> null"
> Cause java.lang.IllegalStateException: Invalid use of
> SingleClientConnManager: connection still allocated. Make sure to release
> the connection before allocating another one."
> 
> If using same HttpClient object is not possible how can I use HttpClient
> object for mutiple connection in threading.
> If I create new Httpclient object for every connection,then also it is not
> working properly.
> 
> Thanks & regards
> Rajkumari
> 
> 
> --
> View this message in context: http://old.nabble.com/same-HttpClient-
> object-for-multiple-threads-it-is-not-working-and-causing-the-exception-
> tp28851451p28851451.html
> Sent from the HttpClient-User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]

Reply via email to