Thanks to visit codestin.com
Credit goes to github.com

Skip to content

J4pClient does not support server failures #14

@ludovicc

Description

@ludovicc

While having a J4pClient which sends periodic requests on a server, I restarted that server.
There was a 404 error, probably caused by a request sent during server restart, but then J4p failed with the message "Invalid use of SingleClientConnManager: connection still allocated.
Make sure to release the connection before allocating another one."

20:27:30.062 [main] ERROR c.b.metrics.harvest.HarvestMetrics - Error - cannot harvest metric
org.jolokia.client.exception.J4pException: 404 Not Found
at org.jolokia.client.J4pClient.extractJsonResponse(J4pClient.java:110) ~[jolokia-client-java-0.80.jar:na]
at org.jolokia.client.J4pClient.execute(J4pClient.java:83) ~[jolokia-client-java-0.80.jar:na]
at org.jolokia.client.J4pClient.execute(J4pClient.java:66) ~[jolokia-client-java-0.80.jar:na]
at com.b.metrics.harvest.HarvestMetrics.execute(HarvestMetrics.java:101) [classes/:na]
at com.b.metrics.harvest.HarvestMetrics.main(HarvestMetrics.java:281) [classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.6.0_22]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ~[na:1.6.0_22]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_22]
at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_22]
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:115) [idea_rt.jar:na]
Harvesting com.b.metrics:type=GroupOfMetrics,name=ApplicationCollector
20:28:30.066 [main] ERROR c.b.metrics.harvest.HarvestMetrics - Error - cannot harvest metric
java.lang.IllegalStateException: Invalid use of SingleClientConnManager: connection still allocated.
Make sure to release the connection before allocating another one.
at org.apache.http.impl.conn.SingleClientConnManager.getConnection(SingleClientConnManager.java:199) ~[httpclient-4.0.1.jar:4.0.1]
at org.apache.http.impl.conn.SingleClientConnManager$1.getConnection(SingleClientConnManager.java:173) ~[httpclient-4.0.1.jar:4.0.1]
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:390) ~[httpclient-4.0.1.jar:4.0.1]
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:641) ~[httpclient-4.0.1.jar:4.0.1]
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:576) ~[httpclient-4.0.1.jar:4.0.1]
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:554) ~[httpclient-4.0.1.jar:4.0.1]
at org.jolokia.client.J4pClient.execute(J4pClient.java:82) ~[jolokia-client-java-0.80.jar:na]
at org.jolokia.client.J4pClient.execute(J4pClient.java:66) ~[jolokia-client-java-0.80.jar:na]
at com.b.metrics.harvest.HarvestMetrics.execute(HarvestMetrics.java:101) [classes/:na]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions