apache/dubbo · error · IllegalArgumentException

Unsupported config type: <config>

Error message

Unsupported config type: <config>

What it means

Thrown by AbstractConfigManager.addConfig() when the supplied AbstractConfig subclass is not a supported config type for that manager. addConfig() is the central registration path; it calls isSupportConfigType() which restricts which config classes a given ConfigManager (application vs module) accepts. Passing an unexpected config type (e.g. a MethodConfig to a manager that excludes it, or a config type not in the supported set) is rejected.

Source

Thrown at dubbo-common/src/main/java/org/apache/dubbo/config/context/AbstractConfigManager.java:158

        // print
        Map<String, Object> map = new LinkedHashMap<>();
        map.put(ConfigKeys.DUBBO_CONFIG_MODE, configMode);
        map.put(ConfigKeys.DUBBO_CONFIG_IGNORE_DUPLICATED_INTERFACE, this.ignoreDuplicatedInterface);
        logger.info("Config settings: " + map);
    }

    /**
     * Add the dubbo {@link AbstractConfig config}
     *
     * @param config the dubbo {@link AbstractConfig config}
     */
    public final <T extends AbstractConfig> T addConfig(AbstractConfig config) {
        if (config == null) {
            return null;
        }
        // ignore MethodConfig
        if (!isSupportConfigType(config.getClass())) {
            throw new IllegalArgumentException("Unsupported config type: " + config);
        }

        if (config.getScopeModel() != scopeModel) {
            config.setScopeModel(scopeModel);
        }

        Class<? extends AbstractConfig> targetConfigType = getTargetConfigType(config.getClass());

        Map<String, AbstractConfig> configsMap = ConcurrentHashMapUtils.computeIfAbsent(
                configsCache, getTagName(targetConfigType), type -> new ConcurrentHashMap<>());

        // fast check duplicated equivalent config before write lock
        if (!(config instanceof ReferenceConfigBase || config instanceof ServiceConfigBase)) {
            for (AbstractConfig value : configsMap.values()) {
                if (value.equals(config)) {
                    return (T) value;
                }
            }

View on GitHub (pinned to 3a3043227f)

Solutions

  1. Confirm the config type is supported by the target ConfigManager (check isSupportConfigType for that class).
  2. Register the config with the correct manager level (e.g. module-scoped configs to ModuleConfigManager).
  3. For MethodConfig, attach it to its parent ServiceConfig/ReferenceConfig rather than registering standalone.

Example fix

// before
applicationConfigManager.addConfig(methodConfig); // MethodConfig not supported here
// after
serviceConfig.addMethod(methodConfig); // attach to parent config
Defensive patterns

Strategy: type-guard

Validate before calling

AbstractConfig config = ...;
if (!configManager.isSupportConfigType(config.getClass())) {
    throw new IllegalArgumentException("Unsupported config type for this manager: " + config.getClass());
}
configManager.addConfig(config);

Type guard

static boolean isSupportedByManager(ConfigManager cm, Class<? extends AbstractConfig> cls) {
    return cm.isSupportConfigType(cls);
}

Try / catch

try {
    configManager.addConfig(config);
} catch (IllegalArgumentException e) {
    if (e.getMessage().startsWith("Unsupported config type")) {
        // route to the correct manager or attach to parent config
    } else throw e;
}

Prevention

When it happens

Trigger: Programmatically calling configManager.addConfig(someConfig) where someConfig's class is not in the manager's supported config types list. Registering a MethodConfig directly when the manager is configured to ignore MethodConfig.

Common situations: Custom bootstrap code that registers configs in the wrong order or to the wrong manager (application-level vs module-level). Framework integrations that attempt to register unsupported config subtypes.

Related errors


AI-assisted analysis of apache/dubbo@3a3043227f (2026-08-14). Data as JSON: /api/errors/0afc017fceba5c0b. Report an issue: GitHub.