Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jolokia Java-Client is throwing ConnectionPoolTimeoutException with PooledHttpClient #309

bcubk opened this issue Mar 9, 2017 · 0 comments · Fixed by #336


Copy link

bcubk commented Mar 9, 2017

We're running the Jolokia-Client in the version 1.3.4 with default timeouts and get following exception:

Caused by: org.apache.http.conn.ConnectionPoolTimeoutException: Timeout waiting for connection from pool at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.leaseConnection( at org.apache.http.impl.conn.PoolingHttpClientConnectionManager$1.get( at org.apache.http.impl.execchain.MainClientExec.execute( at org.apache.http.impl.execchain.ProtocolExec.execute( at org.apache.http.impl.execchain.RetryExec.execute( at org.apache.http.impl.execchain.RedirectExec.execute( at org.apache.http.impl.client.InternalHttpClient.doExecute( at org.apache.http.impl.client.CloseableHttpClient.execute( at org.apache.http.impl.client.CloseableHttpClient.execute( at org.apache.http.impl.client.CloseableHttpClient.execute( at org.jolokia.client.J4pClient.execute( ... 8 more

We digged into the code and found propably a bug in the J4pRequestHandler#extractJsonResponse method. In the finally-Block there is following routine:

HttpEntity entity = pHttpResponse.getEntity();
try {
  // getContent()
finally {
if (entity != null) {

The entity.consumeContent(); is deprecated since Apache HTTPClient 4.1 (see, because it doesn't ensures that the entity content is fully consumed.
Without this procedure the content stream still exists and the connection cannot be released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
1 participant