quarkusio/quarkus · error · UncheckedIOException
Exception processing resources for path ${path}
Error message
Exception processing resources for path ${path} What it means
During the OpenAPI build step, Quarkus enumerates classpath resources for a given path using the thread context class loader. If ClassLoader.getResources(path) throws an IOException, the processor wraps it in an UncheckedIOException with this message, failing the build.
Source
Thrown at extensions/smallrye-openapi/deployment/src/main/java/io/quarkus/smallrye/openapi/deployment/SmallRyeOpenApiProcessor.java:1277
return resolver::resolveContextRoot;
}
private UnaryOperator<Type> getTypeConverter(IndexView indexView, Capabilities capabilities) {
if (capabilities.isPresent(Capability.RESTEASY) || capabilities.isPresent(Capability.RESTEASY_REACTIVE)) {
return new RESTEasyExtension(indexView)::resolveAsyncType;
} else {
return UnaryOperator.identity();
}
}
private Stream<? extends InputStream> loadResources(String path, List<Pattern> ignorePatterns) {
Spliterator<URL> resources;
try {
var resourceEnum = Thread.currentThread().getContextClassLoader().getResources(path).asIterator();
resources = Spliterators.spliteratorUnknownSize(resourceEnum, Spliterator.IMMUTABLE);
} catch (IOException ex) {
throw new UncheckedIOException("Exception processing resources for path " + path, ex);
}
return StreamSupport.stream(resources, false)
.filter(url -> !shouldIgnore(ignorePatterns, url.toString()))
.map(url -> loadResource(path, url))
.filter(Objects::nonNull);
}
private InputStream loadResource(String path, URL url) {
Supplier<String> msg = () -> "An error occurred while processing %s for %s".formatted(url, path);
try {
return ClassPathUtils.readStream(url, inputStream -> {
if (inputStream != null) {
try {
byte[] contents = IoUtil.readBytes(inputStream);
return new ByteArrayInputStream(contents);
} catch (IOException ioe) {View on GitHub (pinned to e1c734241f)
Solutions
- Run a clean build: ./mvnw clean package to rule out stale/corrupt build output
- Wipe and re-download dependencies: delete the offending artifact from ~/.m2/repository and rebuild
- Check file permissions and disk health on the project and Maven cache directories; on Windows check for file locks (IDE/indexers)
Example fix
# before (corrupt jar in cache) rm -rf ~/.m2/repository/org/example/broken-artifact ./mvnw clean package
Defensive patterns
Strategy: fallback
Validate before calling
URL probe = Thread.currentThread().getContextClassLoader().getResource(path);
if (probe == null) { /* skip scan instead of enumerating */ } Try / catch
try { ...augmentation... } catch (UncheckedIOException e) { log.error("Resource enumeration failed for " + e.getMessage()); throw e; } Prevention
- Keep the local Maven repository clean; re-download corrupted jars
- Avoid file locks (antivirus, sync tools) on the build machine
- Run clean builds after dependency changes
When it happens
Trigger: IOException while querying the classloader for resources at the scanned path — typically a broken/closed classloader, corrupted classpath entry, or I/O error reading a jar/directory during augmentation.
Common situations: Corrupted dependency jars in the local Maven repository; file-system/permission problems on the build machine; very unusual classloader setups or locked files on Windows.
Related errors
- Failed to read %s
- Failed to read resources from classpath
- Could not read class path resources having path '${resourceP
- Failed to load + pomPropsPath + from the classpath
- Classpath resource + pomPropsPath + is missing groupId
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/ba22647d9c8a71b7.
Report an issue: GitHub.