{"record":{"id":"ba22647d9c8a71b7","repo":"quarkusio/quarkus","slug":"exception-processing-resources-for-path-path","errorCode":null,"errorMessage":"Exception processing resources for path ${path}","messagePattern":"Exception processing resources for path (.+?)","errorType":"exception","errorClass":"UncheckedIOException","httpStatus":null,"severity":"error","filePath":"extensions/smallrye-openapi/deployment/src/main/java/io/quarkus/smallrye/openapi/deployment/SmallRyeOpenApiProcessor.java","lineNumber":1277,"sourceCode":"        return resolver::resolveContextRoot;\n    }\n\n    private UnaryOperator<Type> getTypeConverter(IndexView indexView, Capabilities capabilities) {\n        if (capabilities.isPresent(Capability.RESTEASY) || capabilities.isPresent(Capability.RESTEASY_REACTIVE)) {\n            return new RESTEasyExtension(indexView)::resolveAsyncType;\n        } else {\n            return UnaryOperator.identity();\n        }\n    }\n\n    private Stream<? extends InputStream> loadResources(String path, List<Pattern> ignorePatterns) {\n        Spliterator<URL> resources;\n\n        try {\n            var resourceEnum = Thread.currentThread().getContextClassLoader().getResources(path).asIterator();\n            resources = Spliterators.spliteratorUnknownSize(resourceEnum, Spliterator.IMMUTABLE);\n        } catch (IOException ex) {\n            throw new UncheckedIOException(\"Exception processing resources for path \" + path, ex);\n        }\n\n        return StreamSupport.stream(resources, false)\n                .filter(url -> !shouldIgnore(ignorePatterns, url.toString()))\n                .map(url -> loadResource(path, url))\n                .filter(Objects::nonNull);\n    }\n\n    private InputStream loadResource(String path, URL url) {\n        Supplier<String> msg = () -> \"An error occurred while processing %s for %s\".formatted(url, path);\n\n        try {\n            return ClassPathUtils.readStream(url, inputStream -> {\n                if (inputStream != null) {\n                    try {\n                        byte[] contents = IoUtil.readBytes(inputStream);\n                        return new ByteArrayInputStream(contents);\n                    } catch (IOException ioe) {","sourceCodeStart":1259,"sourceCodeEnd":1295,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/smallrye-openapi/deployment/src/main/java/io/quarkus/smallrye/openapi/deployment/SmallRyeOpenApiProcessor.java#L1259-L1295","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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)"],"exampleFix":"# before (corrupt jar in cache)\nrm -rf ~/.m2/repository/org/example/broken-artifact\n./mvnw clean package","handlingStrategy":"fallback","validationCode":"URL probe = Thread.currentThread().getContextClassLoader().getResource(path);\nif (probe == null) { /* skip scan instead of enumerating */ }","typeGuard":null,"tryCatchPattern":"try { ...augmentation... } catch (UncheckedIOException e) { log.error(\"Resource enumeration failed for \" + e.getMessage()); throw e; }","preventionTips":["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"],"tags":["io","classpath","build"],"backgroundTag":"ioexception-resource-loading","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}