{"record":{"id":"8c5f7f7c355ca190","repo":"apache/dolphinscheduler","slug":"parameter-types-lists-newarraylist-standardrp","errorCode":null,"errorMessage":"Parameter types: \" + Lists.newArrayList(standardRpcRequest.getArgsTypes()) + \" do not match the method signature.","messagePattern":"Parameter types: \" \\+ Lists\\.newArrayList\\(standardRpcRequest\\.getArgsTypes\\(\\)\\) \\+ \" do not match the method signature\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/server/JdkDynamicServerHandler.java","lineNumber":107,"sourceCode":"                StandardRpcResponse iRpcResponse =\n                        StandardRpcResponse.fail(\"Cannot find the ServerMethodInvoker of \" + methodIdentifier);\n                TransporterHeader transporterHeader =\n                        TransporterHeader.of(transporter.getHeader().getOpaque(), methodIdentifier);\n                Transporter response = Transporter.of(transporterHeader, iRpcResponse);\n                channel.writeAndFlush(response);\n                return;\n            }\n            methodInvokeExecutor.execute(() -> {\n                StandardRpcResponse iRpcResponse;\n                try {\n                    StandardRpcRequest standardRpcRequest =\n                            JsonSerializer.deserialize(transporter.getBody(), StandardRpcRequest.class);\n                    Object[] args;\n                    if (standardRpcRequest.getArgs() == null || standardRpcRequest.getArgs().length == 0) {\n                        args = null;\n                    } else {\n                        if (!methodInvoker.isParameterTypeValidated(standardRpcRequest.getArgsTypes())) {\n                            throw new IllegalArgumentException(\n                                    \"Parameter types: \" + Lists.newArrayList(standardRpcRequest.getArgsTypes())\n                                            + \" do not match the method signature.\");\n                        }\n                        args = new Object[standardRpcRequest.getArgs().length];\n                        for (int i = 0; i < standardRpcRequest.getArgs().length; i++) {\n                            args[i] = JsonSerializer.deserialize(standardRpcRequest.getArgs()[i],\n                                    standardRpcRequest.getArgsTypes()[i]);\n                        }\n                    }\n                    Object result = methodInvoker.invoke(args);\n                    if (result == null) {\n                        iRpcResponse = StandardRpcResponse.success(null, null);\n                    } else {\n                        iRpcResponse = StandardRpcResponse.success(JsonSerializer.serialize(result), result.getClass());\n                    }\n                } catch (Throwable e) {\n                    log.error(\"Invoke method {} failed, {}.\", methodIdentifier, e.getMessage(), e);\n                    iRpcResponse = StandardRpcResponse.fail(e.getMessage());","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/server/JdkDynamicServerHandler.java#L89-L125","documentation":"JdkDynamicServerHandler.processReceived dispatches an incoming RPC to the target interface method via a MethodInvoker. Before invoking, it validates the deserialized argument type names against the actual method signature; a mismatch throws IllegalArgumentException so the caller gets a failed RPC response instead of a reflective crash.","triggerScenarios":"A StandardRpcRequest arrives whose argsTypes array does not match the parameter types of the server-side interface method resolved by method name — e.g. client and server interface definitions differ, or the client sends wrong type descriptors.","commonSituations":"Client and server built against different versions of the same API interface (parameter type changed); client calling a same-named method with different signature on a stale server; custom SDK generating incorrect argsTypes; classpath conflicts where the interface differs on both ends.","solutions":["Rebuild/redeploy client and server against the same version of the API interface module","Compare argsTypes sent by the client with the actual method parameter types on the server","Clear stale jars/dependency conflicts so both ends load the identical interface class","Update the client call site to pass arguments matching the current method signature"],"exampleFix":"// before\n// client interface: TaskClient.dispatch(TaskExecutionContext ctx)\n// server interface: TaskClient.dispatch(TaskExecuteContext ctx)  // renamed type\nrpcClient.send(TaskClient.class, \"dispatch\", executionContext);\n// after\n// align both ends on the same interface type, then\nrpcClient.send(TaskClient.class, \"dispatch\", executionContext); // same TaskExecutionContext on both ends","handlingStrategy":"validation","validationCode":"// validate argument types against the target interface method before sending\nClass<?>[] expected = targetMethod.getParameterTypes();\nString[] sent = request.getArgsTypes();\nif (expected.length != sent.length || !java.util.Arrays.equals(\n        java.util.Arrays.stream(expected).map(Class::getName).toArray(), sent)) {\n    throw new IllegalStateException(\"RPC arg types do not match \" + targetMethod);\n}","typeGuard":null,"tryCatchPattern":"try {\n    Object result = rpcClient.send(iface, method, args);\n} catch (Exception e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"do not match the method signature\")) {\n        // client/server interface mismatch: resync API module versions\n    }\n    throw e;\n}","preventionTips":["Keep the API interface module at the same version on client and server","Regenerate stubs/SDKs after any interface signature change","Add CI checks that both deployments resolve the same interface class version"],"tags":["rpc","reflection","type-mismatch","version-mismatch"],"backgroundTag":"type-mismatch","analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}