{"record":{"id":"6a2a229c6f9a397c","repo":"apache/cassandra","slug":"bad-query-to-jmx-server","errorCode":null,"errorMessage":"Bad query to JMX server: ","messagePattern":"Bad query to JMX server: ","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tools/NodeProbe.java","lineNumber":1993,"sourceCode":"    {\n        try\n        {\n            Multimap<String, String> threadPools = HashMultimap.create();\n\n            Set<ObjectName> threadPoolObjectNames = mbeanServerConn.queryNames(\n                    new ObjectName(\"org.apache.cassandra.metrics:type=ThreadPools,*\"),\n                    null);\n\n            for (ObjectName oName : threadPoolObjectNames)\n            {\n                threadPools.put(oName.getKeyProperty(\"path\"), oName.getKeyProperty(\"scope\"));\n            }\n\n            return threadPools;\n        }\n        catch (MalformedObjectNameException e)\n        {\n            throw new RuntimeException(\"Bad query to JMX server: \", e);\n        }\n        catch (IOException e)\n        {\n            throw new RuntimeException(\"Error getting threadpool names from JMX\", e);\n        }\n    }\n\n    public Object getThreadPoolMetric(String pathName, String poolName, String metricName)\n    {\n      String name = String.format(\"org.apache.cassandra.metrics:type=ThreadPools,path=%s,scope=%s,name=%s\",\n              pathName, poolName, metricName);\n\n      try\n      {\n          ObjectName oName = new ObjectName(name);\n          if (!mbeanServerConn.isRegistered(oName))\n          {\n              return \"N/A\";","sourceCodeStart":1975,"sourceCodeEnd":2011,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/NodeProbe.java#L1975-L2011","documentation":"RuntimeException wrapper from NodeProbe when querying thread pool MBeans: a MalformedObjectNameException while constructing the ObjectName pattern org.apache.cassandra.metrics:type=ThreadPools,* was caught and rethrown as 'Bad query to JMX server'. Since the pattern is hardcoded, this indicates an environment/registration anomaly rather than user input.","triggerScenarios":"Thrown at src/java/org/apache/cassandra/tools/NodeProbe.java:1993 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the nodetool command; the failure is typically transient JMX connectivity related","Verify JMX connectivity and that the remote MBean server is responding","Check the full chained exception for the malformed name details"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}