{"record":{"id":"d85376b74731a28e","repo":"quarkusio/quarkus","slug":"unable-to-find-a-template-for-these-candidates-c","errorCode":null,"errorMessage":"Unable to find a template for these candidates ${candidates}","messagePattern":"Unable to find a template for these candidates (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"devtools/config-doc-maven-plugin/src/main/java/io/quarkus/maven/config/doc/GenerateConfigDocMojo.java","lineNumber":487,"sourceCode":"        candidates.add(\n                root + \"/\" + format + \"/\" + theme + \"/\" + (tag ? \"tags/\" : \"\") + template + \".qute.\" + format.getExtension());\n        if (!Format.DEFAULT_THEME.equals(theme)) {\n            candidates\n                    .add(root + \"/\" + format + \"/\" + Format.DEFAULT_THEME + \"/\" + (tag ? \"tags/\" : \"\") + template + \".qute.\"\n                            + format.getExtension());\n        }\n\n        InputStream is = null;\n        ;\n        for (String candidate : candidates) {\n            is = Thread.currentThread().getContextClassLoader().getResourceAsStream(candidate);\n            if (is != null) {\n                break;\n            }\n        }\n\n        if (is == null) {\n            throw new IllegalArgumentException(\"Unable to find a template for these candidates \" + candidates);\n        }\n\n        try {\n            return new String(is.readAllBytes(), StandardCharsets.UTF_8);\n        } catch (IOException e) {\n            throw new UncheckedIOException(\"Unable to read the template: \" + template, e);\n        } finally {\n            try {\n                is.close();\n            } catch (IOException e) {\n                throw new UncheckedIOException(\"Unable to close InputStream for template: \" + template, e);\n            }\n        }\n    }\n\n    private static Set<String> collectDuplicatePropertyPaths(MergedModel mergedModel) {\n        Set<String> seenBuildTime = new HashSet<>();\n        Set<String> seenRunTime = new HashSet<>();","sourceCodeStart":469,"sourceCodeEnd":505,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/devtools/config-doc-maven-plugin/src/main/java/io/quarkus/maven/config/doc/GenerateConfigDocMojo.java#L469-L505","documentation":"getTemplate loads the Qute templates used by the doc generator from the classpath and throws IllegalArgumentException when none of the candidate template resource names could be opened. This means the plugin's bundled template resources are missing from the classpath.","triggerScenarios":"initializeQuteEngine resolves a template locator that calls getTemplate; every candidate InputStream is null, i.e. no candidate resource exists for the configured format/theme.","commonSituations":"A mismatched or corrupted quarkus-config-doc-maven-plugin jar missing its template resources; using a custom format/theme value that has no matching template; version skew between the plugin and its templates.","solutions":["Rebuild/reinstall the plugin or update it to a consistent released version","Check the configured format/theme maps to an existing bundled template","Inspect the plugin jar for the template resources (unzip -l) to confirm presence"],"exampleFix":"// before\nmvn io.quarkus:quarkus-config-doc-maven-plugin:... -Dformat=custom\n// after\nmvn io.quarkus:quarkus:config-doc-maven-plugin:... -Dformat=asciidoc","handlingStrategy":"fallback","validationCode":"// Verify the plugin jar carries its templates\nProcess p = new ProcessBuilder(\"unzip\", \"-l\",\n    pluginJarPath, \"|\", \"grep\", \"templates\").start();","typeGuard":null,"tryCatchPattern":"try {\n    mojo.execute();\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"Unable to find a template\")) {\n        logger.error(\"Reinstall plugin: \" + e.getMessage());\n    }\n}","preventionTips":["Use only released, consistent plugin versions","Stick to documented format/theme values","Validate local repo artifacts after flaky downloads"],"tags":["maven","classpath","template"],"backgroundTag":"missing-classpath-resource","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}