{"id":"6bf6dc95b4a237c9","repo":"spring-projects/spring-framework","slug":"no-matching-beantype-getsimplename-bean-found-6bf6dc","errorCode":null,"errorMessage":"No matching ${beanType.getSimpleName()} bean found for qualifier '${qualifier}' - neither qualifier match nor bean name match!","messagePattern":"No matching (.+?) bean found for qualifier '(.+?)' - neither qualifier match nor bean name match!","errorType":"exception","errorClass":"NoSuchBeanDefinitionException","httpStatus":null,"severity":"error","filePath":"spring-beans/src/main/java/org/springframework/beans/factory/annotation/BeanFactoryAnnotationUtils.java","lineNumber":138,"sourceCode":"\t\tString[] candidateBeans = BeanFactoryUtils.beanNamesForTypeIncludingAncestors(beanFactory, beanType);\n\t\tString matchingBean = null;\n\t\tfor (String beanName : candidateBeans) {\n\t\t\tif (isQualifierMatch(qualifier::equals, beanName, beanFactory)) {\n\t\t\t\tif (matchingBean != null) {\n\t\t\t\t\tthrow new NoUniqueBeanDefinitionException(beanType, matchingBean, beanName);\n\t\t\t\t}\n\t\t\t\tmatchingBean = beanName;\n\t\t\t}\n\t\t}\n\t\tif (matchingBean != null) {\n\t\t\treturn beanFactory.getBean(matchingBean, beanType);\n\t\t}\n\t\telse if (beanFactory.containsBean(qualifier) && beanFactory.isTypeMatch(qualifier, beanType)) {\n\t\t\t// Fallback: target bean at least found by bean name - probably a manually registered singleton.\n\t\t\treturn beanFactory.getBean(qualifier, beanType);\n\t\t}\n\t\telse {\n\t\t\tthrow new NoSuchBeanDefinitionException(qualifier, \"No matching \" + beanType.getSimpleName() +\n\t\t\t\t\t\" bean found for qualifier '\" + qualifier + \"' - neither qualifier match nor bean name match!\");\n\t\t}\n\t}\n\n\t/**\n\t * Determine the {@link Qualifier#value() qualifier value} for the given\n\t * annotated element.\n\t * @param annotatedElement the class, method or parameter to introspect\n\t * @return the associated qualifier value, or {@code null} if none\n\t * @since 6.2\n\t */\n\tpublic static @Nullable String getQualifierValue(AnnotatedElement annotatedElement) {\n\t\tQualifier qualifier = AnnotationUtils.getAnnotation(annotatedElement, Qualifier.class);\n\t\treturn (qualifier != null ? qualifier.value() : null);\n\t}\n\n\t/**\n\t * Check whether the named bean declares a qualifier of the given name.","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/spring-projects/spring-framework/blob/e8729d043887bf0d0baf91e062e909b56eb2b708/spring-beans/src/main/java/org/springframework/beans/factory/annotation/BeanFactoryAnnotationUtils.java#L120-L156","documentation":"Error \"No matching ${beanType.getSimpleName()} bean found for qualifier '${qualifier}' - neither qualifier match nor bean name match!\" thrown in spring-projects/spring-framework.","triggerScenarios":"Thrown at spring-beans/src/main/java/org/springframework/beans/factory/annotation/BeanFactoryAnnotationUtils.java:138 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"e8729d043887bf0d0baf91e062e909b56eb2b708","analyzedAt":"2026-08-04T19:07:39.725Z","schemaVersion":2}