{"record":{"id":"6aa78e6b4cb07bc6","repo":"quarkusio/quarkus","slug":"unable-to-preload-message-template","errorCode":null,"errorMessage":"Unable to preload message template: ","messagePattern":"Unable to preload message template: ","errorType":"exception","errorClass":"java.lang.IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/qute/runtime/src/main/java/io/quarkus/qute/i18n/MessageBundles.java","lineNumber":169,"sourceCode":"                    return localeResolver != null ? localeResolver.resolve(context) : defaultResolver.resolve(context);\n                }\n\n                @Override\n                public String getNamespace() {\n                    return bundleName;\n                }\n            });\n        }\n    }\n\n    static void preloadMessageTemplates(@Observes Engine engine, Instance<BundleContext> context) {\n        if (!context.isResolvable()) {\n            return;\n        }\n        for (String key : context.get().getMessageTemplates().keySet()) {\n            Template messageTemplate = engine.getTemplate(key);\n            if (messageTemplate == null) {\n                throw new IllegalStateException(\"Unable to preload message template: \" + key);\n            }\n        }\n    }\n\n    public static Template getTemplate(String id) {\n        return Arc.container().instance(Engine.class).get().getTemplate(id);\n    }\n\n}\n","sourceCodeStart":151,"sourceCodeEnd":179,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/qute/runtime/src/main/java/io/quarkus/qute/i18n/MessageBundles.java#L151-L179","documentation":"MessageBundles.preloadMessageTemplates eagerly resolves each message bundle key to a compiled Qute template at startup. When the engine has no template registered under a bundle's key, it means the annotated @MessageBundle interface's generated template files are missing from the deployment, so startup fails fast instead of failing lazily at first use.","triggerScenarios":"Calling preloadMessageTemplates (done automatically at startup when quarkus.qute.i18n.preload=true or for default bundles) while the template file corresponding to a message key (e.g. msg/index.html under the bundle's directory) does not exist in src/main/resources/templates.","commonSituations":"Renaming a message bundle @Location or bundle name without renaming the template directory; deleting or moving .html/.txt template files; build resource filtering excluding templates; typos between the bundle name and the templates directory name.","solutions":["Add or restore the missing template file matching the reported key under src/main/resources/templates (e.g. templates/msg/app.properties or the localized template).","Check the bundle's @Location and name match the directory/files actually present in resources.","Ensure your build does not exclude template resources (maven resource filtering/includes).","Disable eager loading with quarkus.qute.i18n.preload=false if preloading is not needed."],"exampleFix":"// before: bundle AppMessages in templates/msg but file missing\n// after:\n// src/main/resources/templates/msg/app.properties\n// hello=Hello {name}","handlingStrategy":"validation","validationCode":"Path tpl = Path.of(\"src/main/resources/templates\", bundleLocation);\nif (!Files.exists(tpl)) throw new IllegalStateException(\"Missing bundle template: \" + tpl);","typeGuard":null,"tryCatchPattern":"try { bundleUsage(); } catch (IllegalStateException e) { if (e.getMessage().startsWith(\"Unable to preload message template\")) { /* restore template or disable preload */ } else throw e; }","preventionTips":["Keep bundle @Location/name and template directories in sync","Add a build check or test that lists expected template resources","Avoid deleting template files referenced by @MessageBundle interfaces"],"tags":["qute","i18n","missing-template","startup"],"backgroundTag":"missing-template-resource","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"}