{"record":{"id":"ceb42a1a388b0e8c","repo":"apache/dubbo","slug":"load-config-failed-id-id-type-cls-getsimplen","errorCode":null,"errorMessage":"load config failed, id: <id>, type:<cls.getSimpleName()>","messagePattern":"load config failed, id: <id>, type:<cls\\.getSimpleName\\(\\)>","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"dubbo-common/src/main/java/org/apache/dubbo/config/context/AbstractConfigManager.java","lineNumber":549,"sourceCode":"                try {\n                    // add default name config (same as id), e.g. dubbo.protocols.rest.port=1234\n                    key = DUBBO + \".\" + AbstractConfig.getPluralTagName(cls) + \".\" + id + \".name\";\n                    if (properties.getProperty(key) == null) {\n                        properties.setProperty(key, id);\n                        addDefaultNameConfig = true;\n                    }\n\n                    config.refresh();\n                    this.addConfig(config);\n                    tmpConfigs.add(config);\n                } catch (Exception e) {\n                    logger.error(\n                            COMMON_PROPERTY_TYPE_MISMATCH,\n                            \"\",\n                            \"\",\n                            \"load config failed, id: \" + id + \", type:\" + cls.getSimpleName(),\n                            e);\n                    throw new IllegalStateException(\"load config failed, id: \" + id + \", type:\" + cls.getSimpleName());\n                } finally {\n                    if (addDefaultNameConfig && key != null) {\n                        properties.remove(key);\n                    }\n                }\n            }\n        });\n\n        // If none config of the type, try load single config\n        if (this.getConfigs(cls).isEmpty()) {\n            // load single config\n            List<Map<String, String>> configurationMaps = environment.getConfigurationMaps();\n            if (ConfigurationUtils.hasSubProperties(configurationMaps, AbstractConfig.getTypePrefix(cls))) {\n                T config;\n                try {\n                    config = createConfig(cls, scopeModel);\n                    config.refresh();\n                } catch (Exception e) {","sourceCodeStart":531,"sourceCodeEnd":567,"githubUrl":"https://github.com/apache/dubbo/blob/3a3043227f5571d25eb2889de5bca22f2914843b/dubbo-common/src/main/java/org/apache/dubbo/config/context/AbstractConfigManager.java#L531-L567","documentation":"Thrown by AbstractConfigManager during bulk config loading when config.refresh() or addConfig() fails for a specific id after the config was successfully instantiated. refresh() re-reads properties into the config object; a failure (type mismatch, invalid value) during refresh surfaces wrapped with the id and config type. Unlike the create failure, the instance existed but its property population failed.","triggerScenarios":"A property value under dubbo.<plural>.<id>.* that cannot be converted to the config field type (e.g. a non-numeric port, invalid enum). refresh() throwing during reflective property binding.","commonSituations":"dubbo.protocols.rest.port=abc (non-integer). A misspelled enum-valued property. Properties referencing values incompatible with the field type after a Dubbo upgrade changed a field type.","solutions":["Check the logged preceding error (COMMON_PROPERTY_TYPE_MISMATCH) for the offending property and value.","Correct the property value type to match the config field (e.g. integer port, valid enum).","Remove unknown/typo'd property keys under that config id's prefix."],"exampleFix":"# before\ndubbo.protocols.rest.port=abc\n# after\ndubbo.protocols.rest.port=8080","handlingStrategy":"try-catch","validationCode":"// Pre-validate property types before refresh\nProperties props = environment.getPropertiesConfiguration();\nString portKey = \"dubbo.protocols.rest.port\";\nif (props.getProperty(portKey) != null) {\n    try { Integer.parseInt(props.getProperty(portKey)); }\n    catch (NumberFormatException e) { throw new IllegalArgumentException(portKey + \" must be integer\"); }\n}\nconfigManager.loadConfigs(ProtocolConfig.class);","typeGuard":"static boolean isIntegerProperty(Properties p, String key) {\n    String v = p.getProperty(key);\n    if (v == null) return true;\n    try { Integer.parseInt(v); return true; } catch (NumberFormatException e) { return false; }\n}","tryCatchPattern":"try {\n    configManager.loadConfigs(ProtocolConfig.class);\n} catch (IllegalStateException e) {\n    if (e.getMessage().startsWith(\"load config failed\")) {\n        // check the COMMON_PROPERTY_TYPE_MISMATCH log line above for the offending property\n    } else throw e;\n}","preventionTips":["Type-check numeric/enum properties in config sanity tests.","Watch the preceding COMMON_PROPERTY_TYPE_MISMATCH log for the offending key.","Keep a schema of expected property types for each config."],"tags":["config","properties","type-mismatch","config-loading"],"backgroundTag":null,"analyzedSha":"3a3043227f5571d25eb2889de5bca22f2914843b","analyzedAt":"2026-08-14T00:43:19.853Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}