{"record":{"id":"0afc017fceba5c0b","repo":"apache/dubbo","slug":"unsupported-config-type-config","errorCode":null,"errorMessage":"Unsupported config type: <config>","messagePattern":"Unsupported config type: <config>","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"dubbo-common/src/main/java/org/apache/dubbo/config/context/AbstractConfigManager.java","lineNumber":158,"sourceCode":"        // print\n        Map<String, Object> map = new LinkedHashMap<>();\n        map.put(ConfigKeys.DUBBO_CONFIG_MODE, configMode);\n        map.put(ConfigKeys.DUBBO_CONFIG_IGNORE_DUPLICATED_INTERFACE, this.ignoreDuplicatedInterface);\n        logger.info(\"Config settings: \" + map);\n    }\n\n    /**\n     * Add the dubbo {@link AbstractConfig config}\n     *\n     * @param config the dubbo {@link AbstractConfig config}\n     */\n    public final <T extends AbstractConfig> T addConfig(AbstractConfig config) {\n        if (config == null) {\n            return null;\n        }\n        // ignore MethodConfig\n        if (!isSupportConfigType(config.getClass())) {\n            throw new IllegalArgumentException(\"Unsupported config type: \" + config);\n        }\n\n        if (config.getScopeModel() != scopeModel) {\n            config.setScopeModel(scopeModel);\n        }\n\n        Class<? extends AbstractConfig> targetConfigType = getTargetConfigType(config.getClass());\n\n        Map<String, AbstractConfig> configsMap = ConcurrentHashMapUtils.computeIfAbsent(\n                configsCache, getTagName(targetConfigType), type -> new ConcurrentHashMap<>());\n\n        // fast check duplicated equivalent config before write lock\n        if (!(config instanceof ReferenceConfigBase || config instanceof ServiceConfigBase)) {\n            for (AbstractConfig value : configsMap.values()) {\n                if (value.equals(config)) {\n                    return (T) value;\n                }\n            }","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/apache/dubbo/blob/3a3043227f5571d25eb2889de5bca22f2914843b/dubbo-common/src/main/java/org/apache/dubbo/config/context/AbstractConfigManager.java#L140-L176","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Confirm the config type is supported by the target ConfigManager (check isSupportConfigType for that class).","Register the config with the correct manager level (e.g. module-scoped configs to ModuleConfigManager).","For MethodConfig, attach it to its parent ServiceConfig/ReferenceConfig rather than registering standalone."],"exampleFix":"// before\napplicationConfigManager.addConfig(methodConfig); // MethodConfig not supported here\n// after\nserviceConfig.addMethod(methodConfig); // attach to parent config","handlingStrategy":"type-guard","validationCode":"AbstractConfig config = ...;\nif (!configManager.isSupportConfigType(config.getClass())) {\n    throw new IllegalArgumentException(\"Unsupported config type for this manager: \" + config.getClass());\n}\nconfigManager.addConfig(config);","typeGuard":"static boolean isSupportedByManager(ConfigManager cm, Class<? extends AbstractConfig> cls) {\n    return cm.isSupportConfigType(cls);\n}","tryCatchPattern":"try {\n    configManager.addConfig(config);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"Unsupported config type\")) {\n        // route to the correct manager or attach to parent config\n    } else throw e;\n}","preventionTips":["Attach MethodConfig to its parent Service/ReferenceConfig, not the manager.","Register module-scoped configs with ModuleConfigManager, app-scoped with ConfigManager.","Check isSupportConfigType in integration tests."],"tags":["config","config-manager","registration","type-validation"],"backgroundTag":null,"analyzedSha":"3a3043227f5571d25eb2889de5bca22f2914843b","analyzedAt":"2026-08-14T00:43:19.853Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}