Closed
Description
Pierre Maréchal opened SPR-11842 and commented
Using @Bean
to declare my HttpInvokerProxyFactoryBean and @Autowire
to inject it, Spring does not seem to resolve that my bean depends on the factory bean.
I've attached a sample project displaying the behaviour.
Simply run "mvn test"
un-commenting the @DependsOn
in MyBean works around the issue though.
Affects: 4.0.5
Attachments:
- demo.zip (4.75 kB)
Issue Links:
- getBeanNamesForType should consider FactoryBean generics for early introspection of config classes as well [SPR-11480] #16105 getBeanNamesForType should consider FactoryBean generics for early introspection of config classes as well
- StackOverflowError for advisor search against factory-bean reference to FactoryBean [SPR-14551] #19119 StackOverflowError for advisor search against factory-bean reference to FactoryBean
- Plain FactoryBean declaration on @Bean method leads to early call (pre injection) [SPR-12141] #16755 Plain FactoryBean declaration on
@Bean
method leads to early call (pre injection) - Regression in 4.1: UnsatisfiedDependencyException because a prototype-scoped FactoryBean is unexpectedly instantiated by getTypeForFactoryBean() [SPR-12786] #17383 Regression in 4.1: UnsatisfiedDependencyException because a prototype-scoped FactoryBean is unexpectedly instantiated by getTypeForFactoryBean()