apache/dubbo · error · IllegalStateException
Failed to override field value of config bean: <this>
Error message
Failed to override field value of config bean: <this>
What it means
Thrown by the config-copy/override path in AbstractConfig (the loop that copies field values from a 'newOne' config bean onto 'this'). Any Throwable during reflective setter invocation or value conversion is logged and rethrown wrapped. The cause carries the real failure (e.g. type mismatch, inaccessible setter, NPE).
Source
Thrown at dubbo-common/src/main/java/org/apache/dubbo/config/AbstractConfig.java:710
if (overrideAll) {
oldMap.forEach(newMap::putIfAbsent);
} else {
newMap.putAll(oldMap);
}
invokeSetParameters(newMap, this);
} else if (isNestedSetter(this, method)) {
// not support
}
} catch (Throwable t) {
logger.error(
COMMON_FAILED_OVERRIDE_FIELD,
"",
"",
"Failed to override field value of config bean: " + this,
t);
throw new IllegalStateException("Failed to override field value of config bean: " + this, t);
}
}
}
/**
* Dubbo config property override
*/
public void refresh() {
if (needRefresh) {
try {
// check and init before do refresh
preProcessRefresh();
refreshWithPrefixes(getPrefixes(), getConfigMode());
} catch (Exception e) {
logger.error(
COMMON_FAILED_OVERRIDE_FIELD,
"",
"",View on GitHub (pinned to 3a3043227f)
Solutions
- Inspect the cause Throwable in the stack trace to identify the failing setter and value.
- Ensure the config bean fields and setter signatures match the Dubbo version in use.
- If a setter validates and rejects a value, correct the value at its source.
- On Java module/SecurityManager restrictions, open the relevant package to Dubbo or remove the restriction.
Example fix
// before // passing wrong-typed value to a config setter during merge config.setX((Object) someValue); // setter expects String // after config.setX(String.valueOf(someValue));
Defensive patterns
Strategy: try-catch
Try / catch
try {
config.refresh(); // or config copy/override path
} catch (IllegalStateException e) {
if (e.getMessage().startsWith("Failed to override field value of config bean")) {
Throwable root = e.getCause();
// inspect root to find the failing setter/value
}
throw e;
} Prevention
- Keep setter signatures and field types consistent with the Dubbo version.
- Make setters null-safe and validate-friendly so merges don't throw.
- Inspect the cause of wrapped override exceptions rather than the wrapper message.
When it happens
Trigger: During config merging/refresh, invoking a setter via reflection threw: argument type mismatch, IllegalAccessException, an NPE inside the setter, or a value conversion error. This happens when one config instance overrides another (e.g. defaults merge, programmatic copy).
Common situations: A config field type changed between versions but an old-style override is applied. A setter performs validation that rejects the incoming value. A reflective access failure under a restrictive module/security setup. Programmatic config objects in an inconsistent state being merged.
Related errors
- Cannot assign nested class when refreshing config: <classNam
- Append parameters failed: <message>
- Can not merge result because missing method [ {merger} ] in
- More than 1 default extension name on extension {}: {}
- cannot find field %s,field is null
AI-assisted analysis of apache/dubbo@3a3043227f (2026-08-14).
Data as JSON: /api/errors/3cad4d13a0097f65.
Report an issue: GitHub.