{"record":{"id":"ea4fbdf78f968e28","repo":"apache/dubbo","slug":"default-config-not-found-for-configtype-getsimple","errorCode":null,"errorMessage":"Default config not found for <configType.getSimpleName()>","messagePattern":"Default config not found for <configType\\.getSimpleName\\(\\)>","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"critical","filePath":"dubbo-common/src/main/java/org/apache/dubbo/config/context/AbstractConfigManager.java","lineNumber":634,"sourceCode":"                } else {\n                    logger.info(\"Ignore invalid config: \" + config);\n                }\n            }\n        } catch (Exception e) {\n            throw new IllegalStateException(\"Add default config failed: \" + configType.getSimpleName(), e);\n        }\n\n        // validate configs\n        Collection<T> configs = this.getConfigs(configType);\n        if (getConfigValidator() != null) {\n            for (T config : configs) {\n                getConfigValidator().validate(config);\n            }\n        }\n\n        // check required default\n        if (isRequired(configType) && configs.isEmpty()) {\n            throw new IllegalStateException(\"Default config not found for \" + configType.getSimpleName());\n        }\n    }\n\n    /**\n     * The component configuration that does not affect the main process does not need to be verified.\n     *\n     * @param config\n     * @param <T>\n     * @return\n     */\n    protected <T extends AbstractConfig> boolean isNeedValidation(T config) {\n        return !(config instanceof MetadataReportConfig);\n    }\n\n    private ConfigValidator getConfigValidator() {\n        if (configValidator == null) {\n            configValidator = applicationModel.getBeanFactory().getBean(ConfigValidator.class);\n        }","sourceCodeStart":616,"sourceCodeEnd":652,"githubUrl":"https://github.com/apache/dubbo/blob/3a3043227f5571d25eb2889de5bca22f2914843b/dubbo-common/src/main/java/org/apache/dubbo/config/context/AbstractConfigManager.java#L616-L652","documentation":"Thrown by AbstractConfigManager.checkDefaultAndValidateConfigs() after the default-creation attempt: if the config type is marked required (isRequired) and still no configs of that type exist, Dubbo cannot proceed and throws. This indicates a mandatory config (commonly ApplicationConfig) is entirely absent after defaults were considered.","triggerScenarios":"Booting Dubbo without an ApplicationConfig (and no property to build one), where ApplicationConfig is a required type. The default-creation path either was skipped or produced nothing valid.","commonSituations":"Forgetting to set dubbo.application.name in Spring Boot. Running embedded Dubbo without configuring the application identity. Removing the application config during a refactor.","solutions":["Provide the required config explicitly: set dubbo.application.name or add an ApplicationConfig bean.","Ensure the required config type is registered before bootstrap validation runs.","Verify isRequired for the type is genuinely needed (do not disable required checks as a workaround without understanding impact)."],"exampleFix":"# before: no application config\n# after\ndubbo.application.name=myApp","handlingStrategy":"validation","validationCode":"// Ensure required config exists before validation\nif (configManager.getConfigs(ApplicationConfig.class).isEmpty()) {\n    ApplicationConfig app = new ApplicationConfig();\n    app.setName(\"myApp\");\n    configManager.addConfig(app);\n}\n// now safe to run required-config check","typeGuard":"static boolean requiredConfigSatisfied(ConfigManager cm, Class<? extends AbstractConfig> cls) {\n    return !cm.getConfigs(cls).isEmpty();\n}","tryCatchPattern":"try {\n    configManager.checkDefaultAndValidateConfigs(ApplicationConfig.class);\n} catch (IllegalStateException e) {\n    if (e.getMessage().startsWith(\"Default config not found\")) {\n        ApplicationConfig app = new ApplicationConfig();\n        app.setName(\"myApp\");\n        configManager.addConfig(app);\n        configManager.checkDefaultAndValidateConfigs(ApplicationConfig.class);\n    } else throw e;\n}","preventionTips":["Always set dubbo.application.name (or provide an ApplicationConfig bean).","Fail fast in bootstrap with a clear message if required config is missing.","Do not disable required checks without understanding downstream impact."],"tags":["config","required-config","application","startup"],"backgroundTag":null,"analyzedSha":"3a3043227f5571d25eb2889de5bca22f2914843b","analyzedAt":"2026-08-14T00:43:19.853Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}