{"record":{"id":"d1adbe53327647a0","repo":"t8y2/dbx","slug":"unsupported-jdbc-plugin-method-method","errorCode":null,"errorMessage":"Unsupported JDBC plugin method: \" + method","messagePattern":"Unsupported JDBC plugin method: \" \\+ method","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"plugins/jdbc/src/main/java/app/dbx/jdbc/DbxJdbcPlugin.java","lineNumber":475,"sourceCode":"                optionalText(params, \"schema\"),\n                requireText(params, \"name\"),\n                requireText(params, \"object_type\")\n            );\n            case \"getColumns\" -> getColumns(\n                connection,\n                optionalText(params, \"database\"),\n                optionalText(params, \"schema\"),\n                requireText(params, \"table\")\n            );\n            case \"getExplainInfo\" -> getExplainInfo(\n                connection,\n                requireText(params, \"sql\"),\n                optionalText(params, \"database\"),\n                optionalText(params, \"schema\"),\n                nonNegativeInt(params, \"timeoutSecs\", -1),\n                optionalText(params, \"mode\")\n            );\n            default -> throw new IllegalArgumentException(\"Unsupported JDBC plugin method: \" + method);\n        };\n    }\n\n    private static ObjectNode connectionTestResult(Connection connection) {\n        ObjectNode result = MAPPER.createObjectNode();\n        result.put(\"ok\", true);\n        ObjectNode databaseInfo = databaseInfo(connection);\n        if (!databaseInfo.isEmpty()) {\n            result.set(\"databaseInfo\", databaseInfo);\n        }\n        return result;\n    }\n\n    private static ObjectNode databaseInfoResult(Connection connection) {\n        ObjectNode result = MAPPER.createObjectNode();\n        ObjectNode databaseInfo = databaseInfo(connection);\n        if (!databaseInfo.isEmpty()) {\n            result.set(\"databaseInfo\", databaseInfo);","sourceCodeStart":457,"sourceCodeEnd":493,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/plugins/jdbc/src/main/java/app/dbx/jdbc/DbxJdbcPlugin.java#L457-L493","documentation":"DbxJdbcPlugin.handle dispatches JSON-RPC plugin methods to typed calls via a switch; the default arm throws IllegalArgumentException for any method name the JDBC plugin does not implement. This guards against unknown or unsupported RPC methods rather than failing later with a confusing NullPointerException or wrong-argument error.","triggerScenarios":"Sending a JSON-RPC request to the JDBC plugin whose \"method\" is not one of the handled names — e.g. a typo like \"query.execute\", a method added in a newer plugin version but sent to an older plugin, or a method belonging to a different plugin (e.g. a MongoDB-only method) routed to the JDBC plugin.","commonSituations":"Client/server version mismatch where the caller assumes a method exists; hand-written test payloads with misspelled method names; generic tooling that broadcasts the same method to all plugins; case-sensitivity issues (\"Query\" vs \"query\").","solutions":["Check the plugin's supported method list and send an exact, correctly-cased method name.","Align client and plugin versions so the method exists on both sides.","Catch IllegalArgumentException in handleLine's caller and return a JSON-RPC 'method not found' error to the client instead of crashing the dispatch."],"exampleFix":"// before\nsend(\"jdbc.executeQuery\", params); // wrong method name\n// after\nsend(\"jdbc.query\", params); // exact supported method name","handlingStrategy":"try-catch","validationCode":"Set<String> JDBC_METHODS = Set.of(/* e.g. \"connect\",\"query\",\"execute\",... as documented for the plugin */);\nif (!JDBC_METHODS.contains(method)) {\n    // reject client-side before sending the RPC\n}","typeGuard":null,"tryCatchPattern":"try {\n    result = plugin.handle(method, params);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"Unsupported JDBC plugin method\")) {\n        respond(method, jsonRpcError(-32601, \"Method not found: \" + method));\n    } else throw e;\n}","preventionTips":["Keep a shared constants file of supported method names on both client and plugin sides.","Pin client and plugin versions together so new methods are never sent to older plugins.","Use exact, case-sensitive method names; avoid routing non-JDBC methods to the JDBC plugin."],"tags":["json-rpc","jdbc","plugin","unknown-method"],"backgroundTag":"unsupported-rpc-method","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}