{"record":{"id":"fee1c2d85a80c828","repo":"apache/dubbo","slug":"found-invalid-method-config-the-interface-interf","errorCode":null,"errorMessage":"Found invalid method config, the interface <interfaceClass.getName()> not found method \"<methodName>\" : [<methodConfig>]","messagePattern":"Found invalid method config, the interface <interfaceClass\\.getName\\(\\)> not found method \"<methodName>\" : \\[<methodConfig>\\]","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"dubbo-common/src/main/java/org/apache/dubbo/config/AbstractInterfaceConfig.java","lineNumber":424,"sourceCode":"            } else {\n                throw new IllegalStateException(msg);\n            }\n        }\n\n        boolean hasMethod = Arrays.stream(interfaceClass.getMethods())\n                .anyMatch(method -> method.getName().equals(methodName));\n        if (!hasMethod) {\n            String msg = \"Found invalid method config, the interface \" + interfaceClass.getName()\n                    + \" not found method \\\"\" + methodName + \"\\\" : [\" + methodConfig + \"]\";\n            if (ignoreInvalidMethodConfig) {\n                logger.warn(CONFIG_NO_METHOD_FOUND, \"\", \"\", msg);\n                return false;\n            } else {\n                if (!isNeedCheckMethod()) {\n                    msg = \"Generic call: \" + msg;\n                    logger.warn(CONFIG_NO_METHOD_FOUND, \"\", \"\", msg);\n                } else {\n                    throw new IllegalStateException(msg);\n                }\n            }\n        }\n        return true;\n    }\n\n    private ArgumentConfig getArgumentByIndex(MethodConfig methodConfig, int argIndex) {\n        if (methodConfig.getArguments() != null && methodConfig.getArguments().size() > 0) {\n            for (ArgumentConfig argument : methodConfig.getArguments()) {\n                if (argument.getIndex() != null && argument.getIndex() == argIndex) {\n                    return argument;\n                }\n            }\n        }\n        return null;\n    }\n\n    @Transient","sourceCodeStart":406,"sourceCodeEnd":442,"githubUrl":"https://github.com/apache/dubbo/blob/3a3043227f5571d25eb2889de5bca22f2914843b/dubbo-common/src/main/java/org/apache/dubbo/config/AbstractInterfaceConfig.java#L406-L442","documentation":"Thrown by AbstractInterfaceConfig.verifyMethodConfig: a MethodConfig names a method that does not exist on the interface (Arrays.stream(interfaceClass.getMethods()).noneMatch(...)), ignore-invalid-method-config is false, and isNeedCheckMethod() is true (non-generic call). Dubbo refuses to configure a method that the interface does not declare.","triggerScenarios":"A <dubbo:method name=\"foo\"> refers to 'foo' which is not declared on the service/reference interface. With generic calls (isNeedCheckMethod()==false) it degrades to a warning instead of throwing; otherwise it throws.","commonSituations":"Typo in the method name. The interface was refactored/renamed and the method config was not updated. Wrong interface class configured. Method name in config doesn't match due to overloaded/generic-erased signatures. Stale config after a service interface change.","solutions":["Correct the method name in the config to exactly match a method declared on the interface.","If the interface changed, update or remove the stale <dubbo:method> entry.","Verify the interface class configured on the service/reference is the intended one.","For generic invocation where unknown methods are expected, confirm isNeedCheckMethod() returns false (generic call) so it only warns."],"exampleFix":"// before\n<dubbo:service interface=\"com.acme.Greeting\">\n  <dubbo:method name=\"gretting\" retries=\"3\"/> <!-- typo -->\n</dubbo:service>\n// after\n<dubbo:service interface=\"com.acme.Greeting\">\n  <dubbo:method name=\"greeting\" retries=\"3\"/>\n</dubbo:service>","handlingStrategy":"validation","validationCode":"void assertMethodExists(MethodConfig mc, Class<?> iface) {\n    boolean ok = java.util.Arrays.stream(iface.getMethods())\n        .anyMatch(m -> m.getName().equals(mc.getName()));\n    if (!ok) throw new IllegalStateException(iface.getName() + \" has no method \" + mc.getName());\n}","typeGuard":"boolean methodExistsOnInterface(String name, Class<?> iface) {\n    return java.util.Arrays.stream(iface.getMethods()).anyMatch(m -> m.getName().equals(name));\n}","tryCatchPattern":"try {\n    serviceConfig.export();\n} catch (IllegalStateException e) {\n    if (e.getMessage().startsWith(\"Found invalid method config\")) { /* correct/remove the method name */ }\n    throw e;\n}","preventionTips":["Keep method config names in sync with the interface after refactors.","Add a config test asserting every configured method exists on the interface.","For generic calls, confirm generic mode so unknown methods only warn."],"tags":["config","method-config","startup","export"],"backgroundTag":null,"analyzedSha":"3a3043227f5571d25eb2889de5bca22f2914843b","analyzedAt":"2026-08-14T00:43:19.853Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}