{"record":{"id":"b7d338ccd2d6292b","repo":"quarkusio/quarkus","slug":"bean-not-found-for-localized-interface-e-value","errorCode":null,"errorMessage":"Bean not found for localized interface [{e.value}] and locale [{e.key}]","messagePattern":"Bean not found for localized interface \\[(.+?)\\] and locale \\[(.+?)\\]","errorType":"exception","errorClass":"java.lang.IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/qute/runtime/src/main/java/io/quarkus/qute/i18n/MessageBundles.java","lineNumber":118,"sourceCode":"    static void setupNamespaceResolvers(@Observes EngineBuilder builder, Instance<BundleContext> context) {\n        if (!context.isResolvable()) {\n            return;\n        }\n        // Avoid injecting \"Instance<Object> instance\" which prevents unused beans removal\n        ArcContainer container = Arc.container();\n        // For every bundle register a new resolver\n        for (Entry<String, Map<String, Class<?>>> entry : context.get().getBundleInterfaces().entrySet()) {\n            final String bundleName = entry.getKey();\n            final Map<String, Resolver> interfaces = new HashMap<>();\n            Resolver resolver = null;\n            for (Entry<String, Class<?>> locEntry : entry.getValue().entrySet()) {\n                if (locEntry.getKey().equals(DEFAULT_LOCALE)) {\n                    resolver = (Resolver) container.select(locEntry.getValue(), Default.Literal.INSTANCE).get();\n                    continue;\n                }\n                Instance<?> found = container.select(locEntry.getValue(), new Localized.Literal(locEntry.getKey()));\n                if (found.isUnsatisfied()) {\n                    throw new IllegalStateException(\n                            Qute.fmt(\"Bean not found for localized interface [{e.value}] and locale [{e.key}]\")\n                                    .data(\"e\", locEntry).render());\n                }\n                if (found.isAmbiguous()) {\n                    throw new IllegalStateException(\n                            Qute.fmt(\"Multiple beans found for localized interface [{e.value}] and locale [{e.key}]\")\n                                    .data(\"e\", locEntry).render());\n                }\n                interfaces.put(locEntry.getKey(), (Resolver) found.get());\n            }\n            final Resolver defaultResolver = resolver;\n\n            builder.addNamespaceResolver(new NamespaceResolver() {\n                @Override\n                public CompletionStage<Object> resolve(EvalContext context) {\n                    Object locale = context.getAttribute(ATTRIBUTE_LOCALE);\n                    if (locale == null) {\n                        Object selectedVariant = context.getAttribute(TemplateInstance.SELECTED_VARIANT);","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/qute/runtime/src/main/java/io/quarkus/qute/i18n/MessageBundles.java#L100-L136","documentation":"During namespace resolver setup, MessageBundles maps each localized bundle interface variant to a CDI bean selected with a @Localized qualifier. If the container has no bean for the interface + locale combination (unsatisfied dependency), setupNamespaceResolvers throws IllegalStateException('Bean not found for localized interface ... and locale ...').","triggerScenarios":"A @MessageBundle interface declares localized variants but the corresponding @Localized bean for a specific locale is missing at runtime — typically when DEFAULT_LOCALE handling is bypassed and a non-default locale key has no registered bean.","commonSituations":"Locale-specific bundle files/beans removed or renamed while the locale map still references them; @Localized annotation value mismatch with the configured locale; build-time/generated bean registration skipped for that locale.","solutions":["Add or restore the @Localized variant for the reported locale (bundle .properties file or @Localized bean)","Ensure the @Localized value matches exactly the locale key being looked up (e.g. 'de-DE' vs 'de')","Rebuild the app so bundle beans are generated for all declared locales","Align quarkus.locales config with the available bundle variants"],"exampleFix":"// before (missing fr variant, still registered in locales)\n// after\n@Localized(\"fr\")\n@MessageBundle\npublic interface AppMessagesFr { ... } // or add messages_fr.properties","handlingStrategy":"validation","validationCode":"// Build-time sanity check: every locale key must have a matching @Localized bean class\nfor (String locale : declaredLocales) {\n    if (!localizedBundleClasses.containsKey(locale)) {\n        throw new IllegalStateException(\"Missing @Localized variant for \" + locale);\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep @Localized values in sync with the locale keys registered by the extension","Add messages_<locale>.properties files for every supported locale","Rebuild after adding locales so generated beans are registered","Test with all configured locales in a @QuarkusTest"],"tags":["qute","i18n","cdi","locale","dependency-injection"],"backgroundTag":"bean-not-found","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"}