apache/hadoop · error · IllegalStateException
The proxies specified for ${combinedProxyInterface} do not c
Error message
The proxies specified for ${combinedProxyInterface} do not cover method ${method} What it means
ProxyCombiner.combine builds one dynamic proxy implementing combinedProxyInterface by delegating each method to one of the given backing proxies. Before creating it, it verifies coverage: every method declared on combinedProxyInterface must exist (by name and parameter types) on at least one backing proxy; the first uncovered method triggers IllegalStateException naming the interface and method. This is a fail-fast wiring check, usually hit while assembling HA-style composite proxies at startup.
Source
Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/ProxyCombiner.java:75
* @param combinedProxyInterface The interface of the combined proxy.
* @param proxies The proxies which should be used as delegates.
* @param <T> The type of the proxy that will be returned.
* @return The combined proxy.
*/
@SuppressWarnings("unchecked")
public static <T> T combine(Class<T> combinedProxyInterface,
Object... proxies) {
methodLoop:
for (Method m : combinedProxyInterface.getMethods()) {
for (Object proxy : proxies) {
try {
proxy.getClass().getMethod(m.getName(), m.getParameterTypes());
continue methodLoop; // go to the next method
} catch (NoSuchMethodException nsme) {
// Continue to try the next proxy
}
}
throw new IllegalStateException("The proxies specified for "
+ combinedProxyInterface + " do not cover method " + m);
}
InvocationHandler handler =
new CombinedProxyInvocationHandler(combinedProxyInterface, proxies);
return (T) Proxy.newProxyInstance(combinedProxyInterface.getClassLoader(),
new Class[] {combinedProxyInterface}, handler);
}
private static final class CombinedProxyInvocationHandler
implements RpcInvocationHandler {
private final Class<?> proxyInterface;
private final Object[] proxies;
private CombinedProxyInvocationHandler(Class<?> proxyInterface,
Object[] proxies) {
this.proxyInterface = proxyInterface;View on GitHub (pinned to 2add963021)
Solutions
- Ensure every method of the combined interface (exact name + parameter types) exists on at least one passed proxy.
- Add or restore the missing method on the backing proxy/translator (keep signatures identical, including parameter types).
- If the combined interface gained methods, update all constituent proxies in the same change.
Example fix
// before
interface Refresh extends RefreshProtocol, RefreshAdminProtocol {}
Refresh combined = (Refresh) ProxyCombiner.combine(Refresh.class,
refreshProxy); // RefreshAdminProtocol methods uncovered -> IllegalStateException
// after
Refresh combined = (Refresh) ProxyCombiner.combine(Refresh.class,
refreshProxy, refreshAdminProxy); // every method covered Defensive patterns
Strategy: validation
Validate before calling
// verify coverage before combine()
outer:
for (Method m : combinedInterface.getMethods()) {
for (Object p : proxies) {
try { p.getClass().getMethod(m.getName(), m.getParameterTypes()); continue outer; }
catch (NoSuchMethodException ignored) { }
}
throw new IllegalStateException("No proxy covers " + m + " - add the missing backing proxy");
}
return ProxyCombiner.combine(combinedInterface, proxies); Prevention
- When adding a method to a combined interface, update constituent translators in the same commit.
- Keep combined-interface methods exact-signature-compatible (name + parameter types) with the backing proxies.
- Add the pre-combine coverage check above as a unit test for composite proxy wiring.
When it happens
Trigger: Calling RPC.waitForProtocolProxy / combining proxies (e.g., HAServiceProtocol + ZKFC-style composites) where one backing proxy class lacks a method present on the combined interface; passing proxies in the wrong order for interfaces with overlapping names but different signatures; adding a method to the combined interface without updating a constituent translator.
Common situations: Custom HA client setups assembling combined protocol proxies; refactors of protocolPB translators where a method was renamed or dropped; tests stubbing one of the proxies with Mockito and losing the method.
Related errors
- Too many or few parameters for request. Method: [{}], Expect
- Too many or few parameters for request. Method: [{}], Expect
- ${theClass.getName()} could not be constructed.
- Call interrupted
- Failed to get connection for {}, {}: {} is already stopped
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/9239a8d6a19dccb3.
Report an issue: GitHub.