-
Notifications
You must be signed in to change notification settings - Fork 38.3k
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
Allow for normal bean wiring semantics for types assignable to Map [SPR-7915] #12570
Comments
Olaf Otto commented I am also affected by this issue. Types compatible to Collection / Map lead to exceptions during autowiring. The origin (as of 3.0.6.release) is in the DefaultListableBeanFactorie's method doResolveDependency(DependencyDescriptor descriptor, Class<?> type, String beanName, Set<String> autowiredBeanNames, TypeConverter typeConverter): (beanName being the name of the bean who's members are being autowired, type the Class of the field that is autowired)
I think there are two issues with this:
and not the other way around
In general, I think this is a rather esoteric use case... |
Olaf Otto commented Attached a maven project verifying the bug against 3.0.6.RELEASE |
Chris Beams commented This deserves more careful attention and testing than we can afford given the close proximity of 3.1 GA; slating for 3.2 Backlog. In the meantime, for the use cases listed, switching to I do agree, however, that in cases such as Also note that I've added the reproduction case attached here to the spring-framework-issues project. See spring-attic/spring-framework-issues@f398411 |
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. |
Costin Leau opened SPR-7915 and commented
When injecting an entity that extends Map, the container automatically assumes the bean names/instances need to be injected even if that's not the case.
Example and discussion here: https://jira.springsource.org/browse/SGF-22
Affects: 3.0.5
Attachments:
Issue Links:
@Produces
(for Array/Map/Collection inject) ("is duplicated by")@Autowired
does not work for target bean of type Collection@Named
Referenced from: commits 4a0fa69
2 votes, 3 watchers
The text was updated successfully, but these errors were encountered: