Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3693332
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:21:55+00:00 2026-05-19T04:21:55+00:00

I am seeing a problem with reusing my http-client after an HttpPost’s execute fails.

  • 0

I am seeing a problem with reusing my http-client after an HttpPost’s execute fails. It can be a timeout or service not available (maybe others). The request might throw a socket-timeout and when i later use the client (with a new HttpPost object) it will throw an illegal state exception. My research indicates that this occurs when the socket is not marked for “reuse” as in the case that naturally occurs if you have two threads and one is in the middle of processing its request before the second thread tries to use the http-client (hence its socket).

I think there is a bug in the http-client code, but there could be either some ‘best practises’ that I am not following correctly or some known work around.

Any help on this would be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T04:21:55+00:00Added an answer on May 19, 2026 at 4:21 am

    My research indicates that this occurs when the socket is not marked for “reuse” as in the case that naturally occurs if you have two threads and one is in the middle of processing its request before the second thread tries to use the http-client (hence its socket).

    HttpClient is not thread-safe by default. You need to use a ThreadSafeClientConnManager.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am seeing a strange problem: I have a linux machine, installed JDK1.6 on
So, I am seeing a curious problem. If I have a function // counter
Seeing this: http://www.suckless.org/wiki.html . A wiki based on Mercurial. Are there any other non-code
After seeing the cool new reputation tab on the stackoverflow user page, I was
After seeing a previous post Making Applications programmed in .NET languages work on older
I am receiving an XML via an HttpPost to my service, and I want
I'm seeing a problem while attempting to run a java servlet under eclipse (Ganymede),
I am seeing a problem with some Scala 2.7.7 code I'm working on, that
I am seeing a problem where I send large messages over wcf net.msmq using
I am having a problem with Hibernate seeing my domain objects doing a purely

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.