apache/dubbo · critical · IllegalStateException

Default config not found for <configType.getSimpleName()>

Error message

Default config not found for <configType.getSimpleName()>

What it means

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.

Source

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

                } else {
                    logger.info("Ignore invalid config: " + config);
                }
            }
        } catch (Exception e) {
            throw new IllegalStateException("Add default config failed: " + configType.getSimpleName(), e);
        }

        // validate configs
        Collection<T> configs = this.getConfigs(configType);
        if (getConfigValidator() != null) {
            for (T config : configs) {
                getConfigValidator().validate(config);
            }
        }

        // check required default
        if (isRequired(configType) && configs.isEmpty()) {
            throw new IllegalStateException("Default config not found for " + configType.getSimpleName());
        }
    }

    /**
     * The component configuration that does not affect the main process does not need to be verified.
     *
     * @param config
     * @param <T>
     * @return
     */
    protected <T extends AbstractConfig> boolean isNeedValidation(T config) {
        return !(config instanceof MetadataReportConfig);
    }

    private ConfigValidator getConfigValidator() {
        if (configValidator == null) {
            configValidator = applicationModel.getBeanFactory().getBean(ConfigValidator.class);
        }

View on GitHub (pinned to 3a3043227f)

Solutions

  1. Provide the required config explicitly: set dubbo.application.name or add an ApplicationConfig bean.
  2. Ensure the required config type is registered before bootstrap validation runs.
  3. Verify isRequired for the type is genuinely needed (do not disable required checks as a workaround without understanding impact).

Example fix

# before: no application config
# after
dubbo.application.name=myApp
Defensive patterns

Strategy: validation

Validate before calling

// Ensure required config exists before validation
if (configManager.getConfigs(ApplicationConfig.class).isEmpty()) {
    ApplicationConfig app = new ApplicationConfig();
    app.setName("myApp");
    configManager.addConfig(app);
}
// now safe to run required-config check

Type guard

static boolean requiredConfigSatisfied(ConfigManager cm, Class<? extends AbstractConfig> cls) {
    return !cm.getConfigs(cls).isEmpty();
}

Try / catch

try {
    configManager.checkDefaultAndValidateConfigs(ApplicationConfig.class);
} catch (IllegalStateException e) {
    if (e.getMessage().startsWith("Default config not found")) {
        ApplicationConfig app = new ApplicationConfig();
        app.setName("myApp");
        configManager.addConfig(app);
        configManager.checkDefaultAndValidateConfigs(ApplicationConfig.class);
    } else throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: Forgetting to set dubbo.application.name in Spring Boot. Running embedded Dubbo without configuring the application identity. Removing the application config during a refactor.

Related errors


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