Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't inject a bean of a collection type [SPR-12412] #17020

Closed
spring-projects-issues opened this issue Nov 6, 2014 · 3 comments
Closed

Can't inject a bean of a collection type [SPR-12412] #17020

spring-projects-issues opened this issue Nov 6, 2014 · 3 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: duplicate A duplicate of another issue

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Nov 6, 2014

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:

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Nov 6, 2014

Juergen Hoeller commented

This looks like a duplicate of #16794: See my comment there for workarounds, and let's continue the discussion there...

Juergen

@spring-projects-issues
Copy link
Collaborator Author

Christopher Smith commented

I do think this is a duplicate, I just couldn't find it with JIRA's special little search parameters.

@sbrannen
Copy link
Member

If you have shown interest in this issue, you may also be interested in the following which is currently scheduled for inclusion in Spring Framework 6.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

3 participants