Reputation: 4245
I always got
java.lang.IllegalStateException: Invalid use of SingleClientConnManager: connection still allocated. Make sure to release the connection before allocating another one.
Exception.I tried to use abort
after use but still remains.
Is there any way to wait for the connection to complete?
Upvotes: 1
Views: 381
Reputation:
If you are using the http client from multiple threads you need to use the ThreadSafeClientConnManager.
Upvotes: 1
Reputation: 1500475
You should call conn.releaseConnection
after you've finished with the first request, which will allow you to get another handle to the same underlying connection for the next request.
If that's not the problem, you need to give more details - your question is fairly unclear at the moment.
Upvotes: 1