quarkusio/quarkus · error · RuntimeException

Failed to load application configuration

Error message

Failed to load application configuration

What it means

Thrown by CodeGenerator.dumpCurrentConfigValues when the build-time configuration of the application cannot be read during code-generation (config tracking) while previously recorded properties are empty. The underlying CodeGenException from readConfig (e.g. failure to build the BuildTimeConfigurationReader or read config service files) is wrapped in a RuntimeException because this method cannot throw checked exceptions. It aborts the code-generation phase of the build.

Source

Thrown at core/deployment/src/main/java/io/quarkus/deployment/CodeGenerator.java:243

            Path outputFile) {
        final LaunchMode mode = LaunchMode.valueOf(launchMode);
        if (previouslyRecordedProperties.isEmpty()) {
            try {
                readConfig(appModel, mode, buildSystemProps, deploymentClassLoader, configReader -> {
                    var config = configReader.initConfiguration(buildSystemProps, new Properties(),
                            appModel.getPlatformProperties());
                    final Map<String, String> allProps = new HashMap<>();
                    for (String name : config.getPropertyNames()) {
                        allProps.put(name, ConfigTrackingValueTransformer.asString(config.getConfigValue(name)));
                    }
                    ConfigTrackingWriter.write(allProps,
                            config.unwrap(SmallRyeConfig.class).getConfigMapping(ConfigTrackingConfig.class),
                            configReader.readConfiguration(config),
                            outputFile);
                    return null;
                });
            } catch (CodeGenException e) {
                throw new RuntimeException("Failed to load application configuration", e);
            }
            return;
        }
        Config config = null;
        try {
            config = getConfig(appModel, mode, buildSystemProps, deploymentClassLoader);
        } catch (CodeGenException e) {
            throw new RuntimeException("Failed to load application configuration", e);
        }
        var valueTransformer = ConfigTrackingValueTransformer.newInstance(config);
        final Properties currentValues = new Properties(previouslyRecordedProperties.size());
        for (var prevProp : previouslyRecordedProperties.entrySet()) {
            var name = prevProp.getKey().toString();
            var currentValue = config.getConfigValue(name);
            final String current = valueTransformer.transform(name, currentValue);
            var originalValue = prevProp.getValue();
            if (!originalValue.equals(current)) {
                log.info("Option " + name + " has changed since the last build from " + originalValue + " to " + current);

View on GitHub (pinned to e1c734241f)

Solutions

  1. Run a clean build (mvn clean quarkus:build / gradle clean build) to discard stale generated config state
  2. Inspect the 'Caused by' chain to find the real configuration failure and fix the offending config property or mapping
  3. Rebuild/refresh dependencies (delete the offending artifact from ~/.m2/repository and re-resolve) if a jar is corrupted
  4. Remove or fix recently added extensions whose config services may be missing or invalid

Example fix

// before: retrying the same broken build
mvn quarkus:dev
// after: clear stale state and inspect the root cause
mvn clean quarkus:dev  # then read the full 'Caused by' stack trace
Defensive patterns

Strategy: try-catch

Validate before calling

// Verify config sources resolve before building
java -jar quarkus-cli.jar config  # or run quarkus:dev and check startup config warnings
// Ensure application.properties parses and quarkus.* keys are recognized
grep -n 'quarkus\.' src/main/resources/application.properties

Try / catch

try {
    CodeGenerator.dumpCurrentConfigValues(appModel, mode, props, cl, prevProps, out);
} catch (RuntimeException e) {
    Throwable cause = e.getCause(); // CodeGenException -> inspect its cause for the real config failure
    throw new IllegalStateException("Fix build-time configuration: " + rootMessage(cause), cause);
}

Prevention

When it happens

Trigger: dumpCurrentConfigValues is called during the Quarkus Maven/Gradle build (config tracking dump) and readConfig throws a CodeGenException — typically because BuildTimeConfigurationReader could not be created (bad config mappings, missing/invalid config service classes on the deployment classloader) or a service file could not be read.

Common situations: Broken or incompatible extension on the build classpath; a config @ConfigMapping class that fails to load; corrupted jar in the local Maven repository; classpath/service-file conflicts between the application module and its dependencies; switching Quarkus versions with stale incremental build state.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/8f0f69bb97ce4316. Report an issue: GitHub.