Can't inject a bean of a collection type [SPR-12412] #17020
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
status: duplicate
A duplicate of another issue
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 typeString
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 typeCollection<String>
.The specific error is
Affects: 4.1.1
Reference URL: https://github.com/chrylis/SPR-12412
Issue Links:
@Autowired
does not work for target bean of type Collection ("duplicates")The text was updated successfully, but these errors were encountered: