Hello,

I have a spring boot application with actuator an camel enabled.

I am able to query via Jolokia API

J4pClient client = new J4pClient("http://localhost:8080/jolokia";);
J4pReadRequest request = new
J4pReadRequest("java.lang:type=Memory","HeapMemoryUsage");
 request.setPath("used");
 J4pReadResponse response = client.execute(request);
System.out.println("Memory used: " + response.getValue());

and

DefaultJolokiaCamelController controller = new
DefaultJolokiaCamelController();
controller.connect("http://localhost:8080/jolokia";, null, null);
List<Map<String, String>> allContext = controller.getCamelContexts();
System.out.println(allContext.toString());

When I enable server compression of my application

server.compression.enabled=false

the way with the J4pClient works as expected while the
DefaultJolokiaCamelController fails
with

org.jolokia.client.exception.J4pException: IO-Error while contacting the
server: org.apache.http.client.ClientProtocolException
at org.jolokia.client.J4pClient.mapException(J4pClient.java:333)
at org.jolokia.client.J4pClient.execute(J4pClient.java:259)
at org.jolokia.client.J4pClient.execute(J4pClient.java:232)
at org.jolokia.client.J4pClient.execute(J4pClient.java:216)
at
org.apache.camel.commands.jolokia.DefaultJolokiaCamelController.getCamelContexts(DefaultJolokiaCamelController.java:205)
at de.test.TestCamelJolokia.runTest(TestCamelJolokia.java:20)
at de.test.TestCamelJolokia.main(TestCamelJolokia.java:12)
Caused by: org.apache.http.client.ClientProtocolException
at
org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:188)
at
org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
at
org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:106)
at
org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:57)
at org.jolokia.client.J4pClient.execute(J4pClient.java:252)
... 5 more
Caused by: org.apache.http.ProtocolException: Not a valid protocol version:
at
org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:262)

Reply via email to