{"record":{"id":"d8d69880756dc328","repo":"apache/cassandra","slug":"throw-new-runtimeexception-e","errorCode":null,"errorMessage":"throw new RuntimeException(e)","messagePattern":"throw new RuntimeException\\(e\\)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"info","filePath":"src/java/org/apache/cassandra/tools/NodeProbe.java","lineNumber":1307,"sourceCode":"        try\n        {\n            return JMX.newMBeanProxy(mbeanServerConn, new ObjectName(\"org.apache.cassandra.db:type=DynamicEndpointSnitch\"), DynamicEndpointSnitchMBean.class);\n        }\n        catch (MalformedObjectNameException e)\n        {\n            throw new RuntimeException(e);\n        }\n    }\n\n    public LocationInfoMBean getLocationInfoProxy()\n    {\n        try\n        {\n            return JMX.newMBeanProxy(mbeanServerConn, new ObjectName(\"org.apache.cassandra.db:type=LocationInfo\"), LocationInfoMBean.class);\n        }\n        catch (MalformedObjectNameException e)\n        {\n            throw new RuntimeException(e);\n        }\n    }\n\n    public ColumnFamilyStoreMBean getCfsProxy(String ks, String cf)\n    {\n        ColumnFamilyStoreMBean cfsProxy = null;\n        try\n        {\n            String type = cf.contains(\".\") ? \"IndexColumnFamilies\" : \"ColumnFamilies\";\n            Set<ObjectName> beans = mbeanServerConn.queryNames(\n                    new ObjectName(\"org.apache.cassandra.db:type=*\" + type +\",keyspace=\" + ks + \",columnfamily=\" + cf), null);\n\n            if (beans.isEmpty())\n                throw new MalformedObjectNameException(\"couldn't find that bean\");\n            assert beans.size() == 1;\n            for (ObjectName bean : beans)\n                cfsProxy = JMX.newMBeanProxy(mbeanServerConn, bean, ColumnFamilyStoreMBean.class);\n        }","sourceCodeStart":1289,"sourceCodeEnd":1325,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/NodeProbe.java#L1289-L1325","documentation":"NodeProbe.getLocationInfoProxy() builds a JMX MBean proxy for org.apache.cassandra.db:type=LocationInfo and wraps MalformedObjectNameException in a RuntimeException. The ObjectName string is a compile-time constant in this code, so this exception should be practically unreachable; it exists only to satisfy the checked exception. Hitting it indicates a JVM/library-level defect, not a user error.","triggerScenarios":"Calling any NodeProbe method that resolves the LocationInfo proxy (e.g. getEndpointSnitchInfoProxy-style lookups of LocationInfo) — only if the hardcoded ObjectName string were malformed, which it is not.","commonSituations":"Essentially never in practice; would appear only if the source was modified with an invalid ObjectName or a broken JMX environment interception name construction.","solutions":["Treat as an internal bug: inspect the chained cause","Verify no local modification or bytecode instrumentation rewrites the ObjectName string","Report/fix the code if the constant was edited"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { probe.getLocationInfoProxy(); } catch (RuntimeException e) { throw new IllegalStateException(\"Unreachable: LocationInfo ObjectName is a constant; see cause\", e); }","preventionTips":["Do not modify hardcoded ObjectName constants in NodeProbe","Report occurrences as a Cassandra bug with the full chained stack trace"],"tags":["jmx","objectname","unreachable"],"backgroundTag":"internal-invariant-violation","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"}