apache/dubbo · error · IllegalStateException
Found invalid method config, the interface <interfaceClass.g
Error message
Found invalid method config, the interface <interfaceClass.getName()> not found method "<methodName>" : [<methodConfig>]
What it means
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.
Source
Thrown at dubbo-common/src/main/java/org/apache/dubbo/config/AbstractInterfaceConfig.java:424
} else {
throw new IllegalStateException(msg);
}
}
boolean hasMethod = Arrays.stream(interfaceClass.getMethods())
.anyMatch(method -> method.getName().equals(methodName));
if (!hasMethod) {
String msg = "Found invalid method config, the interface " + interfaceClass.getName()
+ " not found method \"" + methodName + "\" : [" + methodConfig + "]";
if (ignoreInvalidMethodConfig) {
logger.warn(CONFIG_NO_METHOD_FOUND, "", "", msg);
return false;
} else {
if (!isNeedCheckMethod()) {
msg = "Generic call: " + msg;
logger.warn(CONFIG_NO_METHOD_FOUND, "", "", msg);
} else {
throw new IllegalStateException(msg);
}
}
}
return true;
}
private ArgumentConfig getArgumentByIndex(MethodConfig methodConfig, int argIndex) {
if (methodConfig.getArguments() != null && methodConfig.getArguments().size() > 0) {
for (ArgumentConfig argument : methodConfig.getArguments()) {
if (argument.getIndex() != null && argument.getIndex() == argIndex) {
return argument;
}
}
}
return null;
}
@TransientView on GitHub (pinned to 3a3043227f)
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.
Example fix
// before <dubbo:service interface="com.acme.Greeting"> <dubbo:method name="gretting" retries="3"/> <!-- typo --> </dubbo:service> // after <dubbo:service interface="com.acme.Greeting"> <dubbo:method name="greeting" retries="3"/> </dubbo:service>
Defensive patterns
Strategy: validation
Validate before calling
void assertMethodExists(MethodConfig mc, Class<?> iface) {
boolean ok = java.util.Arrays.stream(iface.getMethods())
.anyMatch(m -> m.getName().equals(mc.getName()));
if (!ok) throw new IllegalStateException(iface.getName() + " has no method " + mc.getName());
} Type guard
boolean methodExistsOnInterface(String name, Class<?> iface) {
return java.util.Arrays.stream(iface.getMethods()).anyMatch(m -> m.getName().equals(name));
} Try / catch
try {
serviceConfig.export();
} catch (IllegalStateException e) {
if (e.getMessage().startsWith("Found invalid method config")) { /* correct/remove the method name */ }
throw e;
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- <dubbo:method> name attribute is required! Please check: <du
- No registry config found or it's not a valid config! The reg
- The local implementation class <localClass.getName()> not im
- More than 1 default extension name on extension {}: {}
- url missing protocol: "<url>"
AI-assisted analysis of apache/dubbo@3a3043227f (2026-08-14).
Data as JSON: /api/errors/fee1c2d85a80c828.
Report an issue: GitHub.