{"record":{"id":"901dbff1c03bb417","repo":"quarkusio/quarkus","slug":"no-bean-found-for-required-type","errorCode":null,"errorMessage":"No bean found for required type [","messagePattern":"No bean found for required type \\[","errorType":"exception","errorClass":"UnsatisfiedResolutionException","httpStatus":null,"severity":"error","filePath":"independent-projects/arc/runtime/src/main/java/io/quarkus/arc/impl/InstanceImpl.java","lineNumber":288,"sourceCode":"                try {\n                    return bean.get(context);\n                } finally {\n                    if (resetCurrentInjectionPoint) {\n                        InjectionPointProvider.setCurrent(context, prev);\n                    }\n                }\n            }\n        },\n                // If @Dependent we need to remove the instance from the CC of this InjectableInstance\n                Dependent.class.equals(bean.getScope()) ? this::destroy : null);\n    }\n\n    @SuppressWarnings(\"unchecked\")\n    private InjectableBean<T> bean() {\n        List<InjectableBean<?>> beans = beans();\n        if (beans.isEmpty()) {\n            ArcContainerImpl.instance().scanRemovedBeans(requiredType, requiredQualifiers.toArray(new Annotation[] {}));\n            throw new UnsatisfiedResolutionException(\n                    \"No bean found for required type [\" + requiredType + \"] and qualifiers [\" + requiredQualifiers + \"]\");\n        } else if (beans.size() > 1) {\n            throw new AmbiguousResolutionException(\"Beans: \" + beans.toString());\n        }\n        return (InjectableBean<T>) beans.iterator().next();\n    }\n\n    public boolean hasDependentInstances() {\n        return creationalContext.hasDependentInstances();\n    }\n\n    @Override\n    public void clearCache() {\n        if (cachedGetResult.isSet()) {\n            creationalContext.release();\n            cachedGetResult.clear();\n        }\n    }","sourceCodeStart":270,"sourceCodeEnd":306,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/arc/runtime/src/main/java/io/quarkus/arc/impl/InstanceImpl.java#L270-L306","documentation":"Instance.get()/getHandle()/getInternal() resolve the required type+qualifiers against the container's beans. If no bean matches, ArC first triggers scanRemovedBeans (which produces a helpful hint if the bean existed at build time but was removed) and then throws UnsatisfiedResolutionException('No bean found for required type [...] and qualifiers [...]').","triggerScenarios":"Calling instance.get()/instance.getHandle() where no bean of requiredType (with the given qualifiers) is registered — the class was never discovered as a bean, is excluded by a build-time condition, or the qualifiers don't match.","commonSituations":"Missing @Inject/@Unremovable on a bean removed as unused by ArC's unused-bean removal; typo in qualifier; type changed (interface vs impl) after a refactor; bean only registered in a different profile or test slice.","solutions":["Verify the target class is a discoverable bean (@ApplicationScoped etc.) and in a package that is indexed (beans.xml discovery, Jandex)","Add @Unremovable or quarkus.arc.unremovable-types=<type> if ArC's unused-bean removal removed it","Check log output near startup for 'removed beans' hints ArC prints via scanRemovedBeans and follow the suggestion","Fix the required type/qualifiers passed to select() so they match the bean's type and binding annotations"],"exampleFix":"// before\ninstance.select(MissingService.class, new Exact.Literal()).get(); // UnsatisfiedResolutionException\n// after\ndeployment: @ApplicationScoped public class MissingService { ... } // ensure bean is registered and not removed","handlingStrategy":"validation","validationCode":"static <T> T getOrThrow(Instance<T> instance, Class<T> type) {\n    if (instance.isUnsatisfied()) {\n        throw new IllegalStateException(\"No bean for \" + type + \" — check @Unremovable and bean discovery\");\n    }\n    return instance.get();\n}","typeGuard":"static <T> boolean resolvable(Instance<T> i) {\n    return !i.isUnsatisfied() && !i.isAmbiguous();\n}","tryCatchPattern":"try {\n    svc = instance.select(PaymentService.class, qualifier).get();\n} catch (UnsatisfiedResolutionException e) {\n    log.errorf(\"Bean %s missing or was removed as unused; add @Unremovable\", PaymentService.class);\n    throw e;\n}","preventionTips":["Check Instance.isUnsatisfied()/isAmbiguous() before get()","Read ArC's 'removed beans' startup warnings and annotate genuinely used beans with @Unremovable","Keep qualifiers on select() consistent with the bean's bindings","Ensure producer/bean classes are in indexed packages (Jandex / beans.xml discovery)"],"tags":["cdi","arc","dependency-injection","unsatisfied-resolution"],"backgroundTag":"unsatisfied-dependency","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"}