You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it doesn't work with Spring 4. Instead, you get a NoSuchBeanDefinitionException stating that there are no beans qualifying for type RetrySampleItemWriter (RetrySampleItemWriter implements ItemWriter). This worked in Spring 3.2.
We generally recommend to declare the most specific dependency as the return type of a factory method, i.e. as specific as the injection points declare it.
Nevertheless, if it worked before, it should still work. Like the other two issues, this is a side effect of our generic-type-aware autowiring algorithm...
Fixed through only checking the method return type constraints if it is actually sufficiently expressive for the required dependency type: In other words, if the match only works against the already created singleton instance but not against the factory method return type, we skip a generic type match check for the factory method signature.
That said, please usually make the factory method return type as specific as possible. That never hurts and makes things work in case of the target bean instance not having been created yet as well.
Uh oh!
There was an error while loading. Please reload this page.
Michael Minella opened SPR-11046 and commented
When using JavaConfig, if the user writes the config method as shown below:
and attempts to use that bean in a class configured as such:
it doesn't work with Spring 4. Instead, you get a NoSuchBeanDefinitionException stating that there are no beans qualifying for type RetrySampleItemWriter (RetrySampleItemWriter implements ItemWriter). This worked in Spring 3.2.
Affects: 4.0 RC1
Issue Links:
@Bean
methodsThe text was updated successfully, but these errors were encountered: