Skip to content

Log warning for single optional constructor when no default constructor to fall back to [SPR-12161] #16775

@spring-projects-issues

Description

@spring-projects-issues

Fabio Franco da Silva opened SPR-12161 and commented

When using Autowired annotation in constructor and the dependency is not required. Spring throws this exception "No qualifying bean of type [MyClassName] found for dependency [collection of MyClassName]: expected at least 1 bean which qualifies as autowire candidate for this dependency". But, when the annotation is changed to the field, the exception not is throwed and the application works normally.

P.S.: Sorry for my english.


Affects: 3.2.11, 4.0.7, 4.1 GA

Referenced from: commits 5cf4524, 80cec01, bf881e4

Backported to: 4.0.8, 3.2.12

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchestype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions