[jbosstools-issues] [JBoss JIRA] (JBIDE-25674) NPE in JolokiaConnectionWrapper.extractStatus

Rob Stryker (JIRA) issues at jboss.org
Tue Jan 30 15:24:00 EST 2018


    [ https://issues.jboss.org/browse/JBIDE-25674?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13526250#comment-13526250 ] 

Rob Stryker commented on JBIDE-25674:
-------------------------------------

[~aurelien.pupier] I've updated my patch a bit with your new added information, however, I *still* feel like I don't have enough information to submit a proper bug report upstream. 

What we know is there is a HttpResponse, and the jolokia libraries are trying to parse the stream into JSON. The parse fails, and so it resorts to the status line instead, and throws an exception that doesn't have a JSONObject pJsonRespObject  (because the parse failed, so no such object exists). 

However, we still don't know what was in the actual stream. What we can assume is that the stream wasn't valid JSON, but we still have no idea what the stream contained.   This is a critical bit of information before we open a bug report upstream. We need to know what the actual response is. 

To actually get at what request was made, we'd need to set a breakpoint in J4pRequestHandler and exactly what type of org.apache.http.* request they're making, then make an identical request in a Main class of our own, and read the stream. Alternatively, we could come up with a curl request or something similar. 

Unfortunately I can't replicate your usecase, so I'm not quite sure what to do here. It'd be very helpful if we could determine what exactly is in the stream. I'll look to see if eventually I can make a main class that does a similar request. 

> NPE in JolokiaConnectionWrapper.extractStatus
> ---------------------------------------------
>
>                 Key: JBIDE-25674
>                 URL: https://issues.jboss.org/browse/JBIDE-25674
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: jmx
>            Reporter: Aurélien Pupier
>
> {noformat}
> !ENTRY org.eclipse.core.jobs 4 2 2018-01-29 15:56:34.020
> !MESSAGE An internal error occurred during: "Connect Job".
> !STACK 0
> java.lang.NullPointerException
> 	at org.jboss.tools.jmx.jolokia.JolokiaConnectionWrapper.extractStatus(JolokiaConnectionWrapper.java:340)
> 	at org.jboss.tools.jmx.jolokia.JolokiaConnectionWrapper.verifyServerReachable(JolokiaConnectionWrapper.java:324)
> 	at org.jboss.tools.jmx.jolokia.JolokiaConnectionWrapper.connect(JolokiaConnectionWrapper.java:113)
> 	at org.jboss.tools.jmx.core.ConnectJob.run(ConnectJob.java:29)
> 	at org.jboss.tools.jmx.ui.internal.actions.DoubleClickAction$1.run(DoubleClickAction.java:71)
> 	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)
> {noformat}
> I put a breakpoint in org.jboss.tools.jmx.jolokia.JolokiaConnectionWrapper.verifyServerReachable() to see which exception it was and it is a "503 Service Unavailable"
> in this case the "response" is null
> 2 possibilities:
> - it is normal that it is null in this case Jboss Tools need to handle this case
> - it is not normal that it is null and in this case, it needs to be reported upstream (even if a null check might nice as a workaround for now)



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)



More information about the jbosstools-issues mailing list