{"record":{"id":"8f0f69bb97ce4316","repo":"quarkusio/quarkus","slug":"failed-to-load-application-configuration","errorCode":null,"errorMessage":"Failed to load application configuration","messagePattern":"Failed to load application configuration","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"core/deployment/src/main/java/io/quarkus/deployment/CodeGenerator.java","lineNumber":243,"sourceCode":"            Path outputFile) {\n        final LaunchMode mode = LaunchMode.valueOf(launchMode);\n        if (previouslyRecordedProperties.isEmpty()) {\n            try {\n                readConfig(appModel, mode, buildSystemProps, deploymentClassLoader, configReader -> {\n                    var config = configReader.initConfiguration(buildSystemProps, new Properties(),\n                            appModel.getPlatformProperties());\n                    final Map<String, String> allProps = new HashMap<>();\n                    for (String name : config.getPropertyNames()) {\n                        allProps.put(name, ConfigTrackingValueTransformer.asString(config.getConfigValue(name)));\n                    }\n                    ConfigTrackingWriter.write(allProps,\n                            config.unwrap(SmallRyeConfig.class).getConfigMapping(ConfigTrackingConfig.class),\n                            configReader.readConfiguration(config),\n                            outputFile);\n                    return null;\n                });\n            } catch (CodeGenException e) {\n                throw new RuntimeException(\"Failed to load application configuration\", e);\n            }\n            return;\n        }\n        Config config = null;\n        try {\n            config = getConfig(appModel, mode, buildSystemProps, deploymentClassLoader);\n        } catch (CodeGenException e) {\n            throw new RuntimeException(\"Failed to load application configuration\", e);\n        }\n        var valueTransformer = ConfigTrackingValueTransformer.newInstance(config);\n        final Properties currentValues = new Properties(previouslyRecordedProperties.size());\n        for (var prevProp : previouslyRecordedProperties.entrySet()) {\n            var name = prevProp.getKey().toString();\n            var currentValue = config.getConfigValue(name);\n            final String current = valueTransformer.transform(name, currentValue);\n            var originalValue = prevProp.getValue();\n            if (!originalValue.equals(current)) {\n                log.info(\"Option \" + name + \" has changed since the last build from \" + originalValue + \" to \" + current);","sourceCodeStart":225,"sourceCodeEnd":261,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/core/deployment/src/main/java/io/quarkus/deployment/CodeGenerator.java#L225-L261","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Run a clean build (mvn clean quarkus:build / gradle clean build) to discard stale generated config state","Inspect the 'Caused by' chain to find the real configuration failure and fix the offending config property or mapping","Rebuild/refresh dependencies (delete the offending artifact from ~/.m2/repository and re-resolve) if a jar is corrupted","Remove or fix recently added extensions whose config services may be missing or invalid"],"exampleFix":"// before: retrying the same broken build\nmvn quarkus:dev\n// after: clear stale state and inspect the root cause\nmvn clean quarkus:dev  # then read the full 'Caused by' stack trace","handlingStrategy":"try-catch","validationCode":"// Verify config sources resolve before building\njava -jar quarkus-cli.jar config  # or run quarkus:dev and check startup config warnings\n// Ensure application.properties parses and quarkus.* keys are recognized\ngrep -n 'quarkus\\.' src/main/resources/application.properties","typeGuard":null,"tryCatchPattern":"try {\n    CodeGenerator.dumpCurrentConfigValues(appModel, mode, props, cl, prevProps, out);\n} catch (RuntimeException e) {\n    Throwable cause = e.getCause(); // CodeGenException -> inspect its cause for the real config failure\n    throw new IllegalStateException(\"Fix build-time configuration: \" + rootMessage(cause), cause);\n}","preventionTips":["Always read the full 'Caused by' chain — the RuntimeException wraps the real config error","Run clean builds after upgrading Quarkus or extensions","Validate application.properties keys with quarkus:dev startup before a full build","Keep the local Maven repository healthy (no partial downloads)"],"tags":["quarkus","build-time-config","code-generation","configuration"],"backgroundTag":"build-time-config-init-failed","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}