spring-projects/spring-framework · error · NoSuchBeanDefinitionException

No matching ${beanType.getSimpleName()} bean found for quali

Error message

No matching ${beanType.getSimpleName()} bean found for qualifier '${qualifier}' - neither qualifier match nor bean name match!

What it means

Error "No matching ${beanType.getSimpleName()} bean found for qualifier '${qualifier}' - neither qualifier match nor bean name match!" thrown in spring-projects/spring-framework.

Source

Thrown at spring-beans/src/main/java/org/springframework/beans/factory/annotation/BeanFactoryAnnotationUtils.java:138

		String[] candidateBeans = BeanFactoryUtils.beanNamesForTypeIncludingAncestors(beanFactory, beanType);
		String matchingBean = null;
		for (String beanName : candidateBeans) {
			if (isQualifierMatch(qualifier::equals, beanName, beanFactory)) {
				if (matchingBean != null) {
					throw new NoUniqueBeanDefinitionException(beanType, matchingBean, beanName);
				}
				matchingBean = beanName;
			}
		}
		if (matchingBean != null) {
			return beanFactory.getBean(matchingBean, beanType);
		}
		else if (beanFactory.containsBean(qualifier) && beanFactory.isTypeMatch(qualifier, beanType)) {
			// Fallback: target bean at least found by bean name - probably a manually registered singleton.
			return beanFactory.getBean(qualifier, beanType);
		}
		else {
			throw new NoSuchBeanDefinitionException(qualifier, "No matching " + beanType.getSimpleName() +
					" bean found for qualifier '" + qualifier + "' - neither qualifier match nor bean name match!");
		}
	}

	/**
	 * Determine the {@link Qualifier#value() qualifier value} for the given
	 * annotated element.
	 * @param annotatedElement the class, method or parameter to introspect
	 * @return the associated qualifier value, or {@code null} if none
	 * @since 6.2
	 */
	public static @Nullable String getQualifierValue(AnnotatedElement annotatedElement) {
		Qualifier qualifier = AnnotationUtils.getAnnotation(annotatedElement, Qualifier.class);
		return (qualifier != null ? qualifier.value() : null);
	}

	/**
	 * Check whether the named bean declares a qualifier of the given name.

View on GitHub (pinned to e8729d0438)

When it happens

Trigger: Thrown at spring-beans/src/main/java/org/springframework/beans/factory/annotation/BeanFactoryAnnotationUtils.java:138 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of spring-projects/spring-framework@e8729d0438 (2026-08-04). Data as JSON: /data/errors/6bf6dc95b4a237c9.json. Report an issue: GitHub.