quarkusio/quarkus · error · IllegalStateException

Unable to manage configurations - no resource directory foun

Error message

Unable to manage configurations - no resource directory found

What it means

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.

Source

Thrown at extensions/devui/deployment/src/main/java/io/quarkus/devui/deployment/menu/ConfigurationProcessor.java:294

            throw new RuntimeException(t);
        }
    }

    static void writeConfig(final String content, final String target) throws IOException {
        Path configPath = getConfigPath(target);
        // to validate the content
        new Properties().load(new StringReader(content));
        try (BufferedWriter writer = Files.newBufferedWriter(configPath, UTF_8)) {
            writer.write(content);
            writer.newLine();
        }
    }

    private static Path getConfigPath(final String target) throws IOException {
        assert target != null;
        List<Path> resourcesDir = DevConsoleManager.getHotReplacementContext().getResourcesDir();
        if (resourcesDir.isEmpty()) {
            throw new IllegalStateException("Unable to manage configurations - no resource directory found");
        }

        Path path = resourcesDir.get(0);
        Path configPath = path.resolve(Paths.get(target).getFileName());
        if (!Files.exists(configPath)) {
            Files.createDirectories(configPath.getParent());
            Files.createFile(configPath);
        }
        return configPath;
    }

    private static int findLineNumber(final Path configPath, final String name) throws IOException {
        PropertiesConfigSource properties = new PropertiesConfigSource(configPath.toUri().toURL());
        ConfigValue fileConfigValue = properties.getConfigValue(name);
        int lineNumber = -1;
        if (fileConfigValue != null) {
            lineNumber = fileConfigValue.getLineNumber();
        }

View on GitHub (pinned to e1c734241f)

Solutions

  1. Ensure the project has a resources directory (src/main/resources) configured in the build (Quarkus default).
  2. Use Dev UI configuration management only while quarkus:dev (dev mode) is running, where the hot-replacement context provides the resources dir.
  3. If resources live elsewhere, configure the build to add that directory to resources so dev mode registers it.
  4. Restart dev mode cleanly (mvn quarkus:dev) to reinitialize the hot-replacement context.
Defensive patterns

Strategy: try-catch

Validate before calling

List<Path> dirs = DevConsoleManager.getHotReplacementContext().getResourcesDir();
if (dirs == null || dirs.isEmpty()) {
    log.warn("Dev UI config management unavailable: no resources directory");
    return;
}

Try / catch

try { Path p = getConfigPath(target); ... }
catch (IllegalStateException e) {
    if (e.getMessage().contains("no resource directory")) {
        respondWithError("Config management requires a resources directory (dev mode)");
    } else throw e;
}

Prevention

When it happens

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

Common situations: 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.

Related errors


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