{"record":{"id":"5b44630607ff32e5","repo":"quarkusio/quarkus","slug":"unable-to-manage-configurations-no-resource-dire","errorCode":null,"errorMessage":"Unable to manage configurations - no resource directory found","messagePattern":"Unable to manage configurations - no resource directory found","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/devui/deployment/src/main/java/io/quarkus/devui/deployment/menu/ConfigurationProcessor.java","lineNumber":294,"sourceCode":"            throw new RuntimeException(t);\n        }\n    }\n\n    static void writeConfig(final String content, final String target) throws IOException {\n        Path configPath = getConfigPath(target);\n        // to validate the content\n        new Properties().load(new StringReader(content));\n        try (BufferedWriter writer = Files.newBufferedWriter(configPath, UTF_8)) {\n            writer.write(content);\n            writer.newLine();\n        }\n    }\n\n    private static Path getConfigPath(final String target) throws IOException {\n        assert target != null;\n        List<Path> resourcesDir = DevConsoleManager.getHotReplacementContext().getResourcesDir();\n        if (resourcesDir.isEmpty()) {\n            throw new IllegalStateException(\"Unable to manage configurations - no resource directory found\");\n        }\n\n        Path path = resourcesDir.get(0);\n        Path configPath = path.resolve(Paths.get(target).getFileName());\n        if (!Files.exists(configPath)) {\n            Files.createDirectories(configPath.getParent());\n            Files.createFile(configPath);\n        }\n        return configPath;\n    }\n\n    private static int findLineNumber(final Path configPath, final String name) throws IOException {\n        PropertiesConfigSource properties = new PropertiesConfigSource(configPath.toUri().toURL());\n        ConfigValue fileConfigValue = properties.getConfigValue(name);\n        int lineNumber = -1;\n        if (fileConfigValue != null) {\n            lineNumber = fileConfigValue.getLineNumber();\n        }","sourceCodeStart":276,"sourceCodeEnd":312,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/devui/deployment/src/main/java/io/quarkus/devui/deployment/menu/ConfigurationProcessor.java#L276-L312","documentation":"The Dev UI Configuration processor lets users view/edit application configuration files, resolving the writable path from the live-reload context's resources directory. getConfigPath throws IllegalStateException when DevConsoleManager.getHotReplacementContext().getResourcesDir() returns an empty list — no resource (e.g. src/main/resources) directory is known to the dev-mode runtime. Configuration management cannot operate without a target directory.","triggerScenarios":"Calling the Dev UI configuration JSON-RPC actions (config editing) while dev mode is running but no resources directory is registered — e.g. the project has no src/main/resources or the hot-replacement context wasn't initialized in the current launch mode.","commonSituations":"Running the app in a mode where Dev Console hot-replacement context isn't active; a project layout with resources placed outside the standard directory (misconfigured build resource dirs); invoking config endpoints from tests or non-dev deployments.","solutions":["Ensure the project has a resources directory (src/main/resources) configured in the build (Quarkus default).","Use Dev UI configuration management only while quarkus:dev (dev mode) is running, where the hot-replacement context provides the resources dir.","If resources live elsewhere, configure the build to add that directory to resources so dev mode registers it.","Restart dev mode cleanly (mvn quarkus:dev) to reinitialize the hot-replacement context."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"List<Path> dirs = DevConsoleManager.getHotReplacementContext().getResourcesDir();\nif (dirs == null || dirs.isEmpty()) {\n    log.warn(\"Dev UI config management unavailable: no resources directory\");\n    return;\n}","typeGuard":null,"tryCatchPattern":"try { Path p = getConfigPath(target); ... }\ncatch (IllegalStateException e) {\n    if (e.getMessage().contains(\"no resource directory\")) {\n        respondWithError(\"Config management requires a resources directory (dev mode)\");\n    } else throw e;\n}","preventionTips":["Keep src/main/resources present and registered in the build","Use Dev UI config management only under quarkus:dev","Check hot-replacement context state before invoking config actions"],"tags":["devui","configuration","dev-mode","resources-directory"],"backgroundTag":"missing-resource-directory","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"}