Closed
Description
Christopher Smith opened SPR-12412 and commented
I have a bean that takes as an optional autowired argument a Collection<String>
of "interesting" keys to watch for. Spring has a hard assumption that this means that the DI container should collect beans of type String
and autowire that; there's no way (at least in JavaConfig, and this looks to be a DI algorithm problem) to autowire a bean of type Collection<String>
.
The specific error is
org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [java.lang.String] found for dependency [collection of java.lang.String]
Affects: 4.1.1
Reference URL: https://github.com/chrylis/SPR-12412
Issue Links:
- @Autowired does not work for target bean of type Collection [SPR-12180] #16794
@Autowired
does not work for target bean of type Collection ("duplicates")