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

  1. Rebuild/restart the application so the known-path index matches the filesystem
  2. Ensure all static resources still exist at build-time paths in the deployed artifact
  3. If layering custom ResourceManagers, make sure getResource resolves every path your list() returns
  4. 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

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


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