quarkusio/quarkus · error · RuntimeException
Unable to get listed resource ${i} from directory ${path} fo
Error message
Unable to get listed resource ${i} from directory ${path} for path ${slashPath} from underlying manager ${underlying} What it means
KnownPathResourceManager only serves a pre-computed list of known resources, but during directory listing the underlying resource manager returned null for an entry that is not a known directory. This is an internal consistency failure: the underlying manager advertised a path in a listing it cannot resolve back to a Resource.
Source
Thrown at extensions/undertow/runtime/src/main/java/io/quarkus/undertow/runtime/KnownPathResourceManager.java:149
SortedSet<String> fileSet = files.tailSet(slashPath);
SortedSet<String> dirSet = directories.tailSet(slashPath);
for (var s : List.of(fileSet, dirSet)) {
for (String file : s) {
var i = file;
if (i.equals(slashPath)) {
continue;
}
if (i.startsWith(slashPath)) {
i = evaluatePath(i);
if (!i.substring(slashPath.length()).contains("/")) {
try {
Resource resource = underlying.getResource(i);
if (resource == null && directories.contains(file)) {
resource = new DirectoryResource(file);
}
if (resource == null) {
throw new RuntimeException("Unable to get listed resource " + i + " from directory " + path
+ " for path " + slashPath + " from underlying manager " + underlying);
}
ret.add(resource);
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
} else {
break;
}
}
}
return ret;
}
@Override
public String getContentType(MimeMappings mimeMappings) {View on GitHub (pinned to e1c734241f)
Solutions
- Rebuild/restart the application so the known-path index matches the filesystem
- Ensure all static resources still exist at build-time paths in the deployed artifact
- If layering custom ResourceManagers, make sure getResource resolves every path your list() returns
- Report upstream if reproducible on a plain Quarkus app — this should not happen normally
Defensive patterns
Strategy: validation
Validate before calling
// check the static resources referenced actually exist in the artifact
assertTrue(Paths.get("target/classes/META-INF/resources").toFile().list().length > 0); Prevention
- Don't delete static files at runtime in dev mode
- Test static-resource routes after hot reloads
- Avoid custom ResourceManager layers unless getResource covers all listed paths
When it happens
Trigger: Calling getResource on a path returned by the underlying manager's list() that the manager cannot resolve; races where files are deleted between list and getResource; mismatched underlying manager behavior inside a Quarkus static-resource setup.
Common situations: Static resources removed/renamed while the app runs (dev-mode hot reload); custom resource managers layered with KnownPathResourceManager; filesystem case-sensitivity differences (macOS vs Linux containers).
Related errors
- Cannot serve directory
- Failed to create output directory for generated sources: %s
- ${archiveRoot} does not point to the application output dire
- Unable to write the model to: ${yamlModelPath}
- Unable to determine the path of target/
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/b676c074088a5bf2.
Report an issue: GitHub.