Closed
Description
Michael Minella opened SPR-11046 and commented
When using JavaConfig, if the user writes the config method as shown below:
@Bean
protected ItemWriter<Object> writer() {
return new RetrySampleItemWriter();
}
and attempts to use that bean in a class configured as such:
@Autowire
private RetrySampleItemWriter<?> itemWriter;
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:
- Consistent autowiring behavior for specifically typed injection points against loosely typed @Bean methods [SPR-14960] #19527 Consistent autowiring behavior for specifically typed injection points against loosely typed
@Bean
methods