Uploaded image for project: 'Cloud Enablement'
  1. Cloud Enablement
  2. CLOUD-2759

Jolokia probe's DeploymentTest fails if there are no deployments

    Details

      Description

      If your run probe.eap.jolokia.EapProbe against a server with no deployments the DeploymentTest fails because the JMX query results in 'javax.management.InstanceNotFoundException : No MBean with pattern jboss.as:deployment=* found for reading attributes'.

      Here's what's passed into the test for evaluation:

      2018-07-31 02:38:38,115 DEBUG [probe.eap.jolokia.EapProbe] Test input = {
          "request": {
              "mbean": "jboss.as:deployment=*",
              "attribute": "status",
              "type": "read"
          },
          "stacktrace": "javax.management.InstanceNotFoundException: No MBean with pattern jboss.as:deployment=* found for reading attributes\n\tat org.jolokia.handle
      r.ReadHandler.searchMBeans(ReadHandler.java:160)\n\tat org.jolokia.handler.ReadHandler.fetchAttributesForMBeanPattern(ReadHandler.java:126)\n\tat org.jolokia.ha
      ndler.ReadHandler.doHandleRequest(ReadHandler.java:116)\n\tat org.jolokia.handler.ReadHandler.doHandleRequest(ReadHandler.java:37)\n\tat org.jolokia.handler.Jso
      nRequestHandler.handleRequest(JsonRequestHandler.java:161)\n\tat org.jolokia.backend.MBeanServerHandler.dispatchRequest(MBeanServerHandler.java:156)\n\tat org.j
      olokia.backend.LocalRequestDispatcher.dispatchRequest(LocalRequestDispatcher.java:99)\n\tat org.jolokia.backend.BackendManager.callRequestDispatcher(BackendMana
      ger.java:428)\n\tat org.jolokia.backend.BackendManager.handleRequest(BackendManager.java:158)\n\tat org.jolokia.http.HttpRequestHandler.executeRequest(HttpReque
      stHandler.java:197)\n\tat org.jolokia.http.HttpRequestHandler.handlePostRequest(HttpRequestHandler.java:131)\n\tat org.jolokia.jvmagent.handler.JolokiaHttpHandl
      er.executePostRequest(JolokiaHttpHandler.java:290)\n\tat org.jolokia.jvmagent.handler.JolokiaHttpHandler.doHandle(JolokiaHttpHandler.java:236)\n\tat org.jolokia
      .jvmagent.handler.JolokiaHttpHandler.handle(JolokiaHttpHandler.java:178)\n\tat com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79)\n\tat sun.net.httpse
      rver.AuthFilter.doFilter(AuthFilter.java:72)\n\tat com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:82)\n\tat sun.net.httpserver.ServerImpl$Exchange$Lin
      kHandler.handle(ServerImpl.java:675)\n\tat com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79)\n\tat sun.net.httpserver.ServerImpl$Exchange.run(ServerI
      mpl.java:645)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(Thr
      eadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\n",
          "error_type": "javax.management.InstanceNotFoundException",
          "error": "javax.management.InstanceNotFoundException : No MBean with pattern jboss.as:deployment=* found for reading attributes",
          "status": 404
      }
      

      Simple fix is for the test to check for that "status": 404 and return Status.READY when that's found. That entry is not an HTTP 404 for the overall request (which is a batch of multiple requests), it's a jolokia protocol value for this particular item, indicating the target mbean does not exist.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                brian.stansberry Brian Stansberry
                Reporter:
                brian.stansberry Brian Stansberry
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: