Skip to content

Confusing/wrong error message when @Autowire fails using the wrong @Qualifier [SPR-5912] #10581

@spring-projects-issues

Description

@spring-projects-issues

Dave Syer opened SPR-5912 and commented

If I @Autowire with a @Qualifier and spell the bean name wrong, I get this:

...
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [org.springframework.batch.core.Job] is defined: Unsatisfied dependency of type [interface org.springframework.batch.core.Job]: expected at least 1 matching bean
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:690)
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:448)
	... 28 more

which looks like there is no bean of the right type. In fact there is at least one, but not one with the right name.


Affects: 3.0 M4

Referenced from: commits 7a10b75

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions