{"record":{"id":"ad8e9e44bb80298b","repo":"quarkusio/quarkus","slug":"an-error-occurred-while-processing-resourcepath","errorCode":null,"errorMessage":"An error occurred while processing ${resourcePath}","messagePattern":"An error occurred while processing (.+?)","errorType":"exception","errorClass":"UncheckedIOException","httpStatus":null,"severity":"error","filePath":"extensions/smallrye-openapi/deployment/src/main/java/io/quarkus/smallrye/openapi/deployment/SmallRyeOpenApiProcessor.java","lineNumber":1328,"sourceCode":"            if (matcher.matches()) {\n                return true;\n            }\n        }\n        return false;\n    }\n\n    private List<String> getResourceFiles(Path resourcePath, Path target) {\n        final String resourceName = ClassPathUtils.toResourceName(resourcePath);\n        List<String> filenames = new ArrayList<>();\n        // Here we are resolving the resource dir relative to the classes dir and if it does not exist, we fall back to locating the resource dir on the classpath.\n        // Although the classes dir should already be on the classpath.\n        // In a QuarkusExtensionTest the module's classes dir and the test application root could be different directories, is this code here for that reason?\n        final Path targetResourceDir = target == null ? null : target.resolve(\"classes\").resolve(resourcePath);\n        if (targetResourceDir != null && Files.exists(targetResourceDir)) {\n            try (Stream<Path> paths = Files.list(targetResourceDir)) {\n                return paths.map(t -> resourceName + \"/\" + t.getFileName().toString()).toList();\n            } catch (IOException e) {\n                throw new UncheckedIOException(\"An error occurred while processing \" + resourcePath, e);\n            }\n        } else {\n            ClassLoader cl = Thread.currentThread().getContextClassLoader();\n            // QuarkusClassLoader will return a ByteArrayInputStream of directory entry names\n            try (InputStream inputStream = cl.getResourceAsStream(resourceName)) {\n                if (inputStream != null) {\n                    try (BufferedReader br = new BufferedReader(new InputStreamReader(inputStream))) {\n                        String resource;\n                        while ((resource = br.readLine()) != null) {\n                            filenames.add(resourceName + \"/\" + resource);\n                        }\n                    }\n                }\n            } catch (IOException e) {\n                throw new UncheckedIOException(\"An error occurred while processing \" + resourcePath, e);\n            }\n        }\n        return filenames;","sourceCodeStart":1310,"sourceCodeEnd":1346,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/smallrye-openapi/deployment/src/main/java/io/quarkus/smallrye/openapi/deployment/SmallRyeOpenApiProcessor.java#L1310-L1346","documentation":"When collecting OpenAPI model resources, the processor first tries to list files in the target classes directory for the resource path. If Files.list on that directory throws IOException, it throws an UncheckedIOException with this message, failing the build.","triggerScenarios":"IOException while listing the directory target/<resourcePath> under the build output — e.g. permission denied, the path exists but is a file, or an I/O error on the filesystem.","commonSituations":"Build output owned by another user/CI artifact with wrong permissions; antivirus or sync tools (Dropbox/OneDrive) locking build dirs; target directory partially deleted during the build.","solutions":["Fix read permissions on the target/ directory, or run ./mvnw clean to regenerate it","Close tools that may lock build output (antivirus, file sync services, open editors/terminals in target/)","Rebuild from a clean checkout if target/ is corrupted"],"exampleFix":"# before (unreadable target dir)\nchmod -R u+rw target/\n./mvnw clean package","handlingStrategy":"try-catch","validationCode":"Path dir = target.resolve(\"classes\").resolve(resourcePath);\nif (!Files.isDirectory(dir) || !Files.isReadable(dir)) { /* fall back to classpath listing */ }","typeGuard":null,"tryCatchPattern":"try { ...build... } catch (UncheckedIOException e) { if (e.getMessage().contains(\"error occurred while processing\")) { fix permissions / clean target and rebuild; } throw e; }","preventionTips":["Ensure target/ is owned and writable by the build user","Exclude build dirs from antivirus/file-sync tools","Run ./mvnw clean when build output looks stale"],"tags":["io","filesystem","build"],"backgroundTag":"ioexception-resource-processing","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"}