{"record":{"id":"ebdc3f43fd26ecbf","repo":"quarkusio/quarkus","slug":"no-compatible-resourceloader-have-been-found-for-f","errorCode":null,"errorMessage":"No compatible ResourceLoader have been found for file type: <fileName>","messagePattern":"No compatible ResourceLoader have been found for file type: <fileName>","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"independent-projects/tools/devtools-common/src/main/java/io/quarkus/platform/descriptor/loader/json/ResourceLoaders.java","lineNumber":48,"sourceCode":"        }\n        try {\n            return new File(url.toURI());\n        } catch (URISyntaxException | IllegalArgumentException e) {\n            throw new IOException(\n                    \"There were a problem while reading the resource dir '\" + name + \"' on the classpath with url: '\"\n                            + url.toString() + \"'\");\n        }\n    }\n\n    public static ResourceLoader resolveFileResourceLoader(File f) {\n        Objects.requireNonNull(f, \"f is required\");\n        if (f.isDirectory()) {\n            return new DirectoryResourceLoader(f.toPath());\n        }\n        if (f.isFile() && FilenameUtils.isExtension(f.getName(), \"jar\", \"zip\")) {\n            return new ZipResourceLoader(f.toPath());\n        }\n        throw new IllegalStateException(\"No compatible ResourceLoader have been found for file type: \" + f.getName());\n    }\n\n    // This method is copied from io.quarkus.runtime.util.ClassPathUtils\n    public static <R> R processAsPath(URL url, Function<Path, R> function) {\n        if (JAR.equals(url.getProtocol())) {\n            final String file = url.getFile();\n            final int exclam = file.lastIndexOf('!');\n            final Path jar;\n            try {\n                jar = toLocalPath(exclam >= 0 ? new URL(file.substring(0, exclam)) : url);\n            } catch (MalformedURLException e) {\n                throw new RuntimeException(\"Failed to create a URL for '\" + file.substring(0, exclam) + \"'\", e);\n            }\n            try (FileSystem jarFs = ZipUtils.newFileSystem(jar)) {\n                Path localPath = jarFs.getPath(\"/\");\n                if (exclam >= 0) {\n                    localPath = localPath.resolve(file.substring(exclam + 1));\n                }","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/tools/devtools-common/src/main/java/io/quarkus/platform/descriptor/loader/json/ResourceLoaders.java#L30-L66","documentation":"resolveFileResourceLoader inspects a File and returns a DirectoryResourceLoader for directories or a ZipResourceLoader for .jar/.zip files. Anything else (other extensions, symlinks to nothing, non-regular files) has no compatible loader, so it throws IllegalStateException naming the file.","triggerScenarios":"Calling resolveFileResourceLoader(f) where f is an existing regular file whose extension is not jar/zip (e.g. .tar.gz, no extension), or a special file that is neither directory nor jar/zip.","commonSituations":"Pointing platform-descriptor resolution at an unpacked-but-misnamed artifact, a .war/.rar, or a partially downloaded file; local repository file renamed without its .jar extension.","solutions":["Rename the file to have a .jar or .zip extension if it is actually one","Ensure the file is a real directory if you intended a directory loader","Re-download/rebuild the artifact — the file may be corrupt or partial","Extend the extension check in resolveFileResourceLoader if you control the code and need more formats"],"exampleFix":"// before\nResourceLoaders.resolveFileResourceLoader(new File(\"repo/descriptor.tar.gz\")); // throws\n// after: use a supported artifact\nResourceLoaders.resolveFileResourceLoader(new File(\"repo/descriptor-3.2.0.jar\"));","handlingStrategy":"validation","validationCode":"File f = ...;\nif (!(f.isDirectory() || FilenameUtils.isExtension(f.getName(), \"jar\", \"zip\"))) {\n    throw new IllegalArgumentException(\"Unsupported resource file: \" + f);\n}","typeGuard":"boolean hasCompatibleLoader(File f) {\n    return f != null && (f.isDirectory() || FilenameUtils.isExtension(f.getName(), \"jar\", \"zip\"));\n}","tryCatchPattern":"try {\n    loader = ResourceLoaders.resolveFileResourceLoader(f);\n} catch (IllegalStateException e) {\n    if (e.getMessage().startsWith(\"No compatible ResourceLoader\")) {\n        throw new ConfigurationException(\"Descriptor source must be a directory, .jar or .zip: \" + f, e);\n    }\n    throw e;\n}","preventionTips":["Only pass directories or .jar/.zip files to resolveFileResourceLoader","Verify artifact integrity after downloads (partial files lose proper structure)","Restore correct file extensions if local-repo files were renamed"],"tags":["filesystem","resource-loading","validation"],"backgroundTag":"unsupported-file-type","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}