Closed
Description
Andruschuk Borislav opened SPR-10984 and commented
Let's consider the following case:
@Configuration
@ImportResource("some.xml")
public class SomeClass { ... }
in some.xml:
<context:component-scan base-package="com.somepackage"/>
in com.somepackage there's class:
@Configuration
public class OtherClass {
@Bean(name="SomeNewBean")
public Object getSomeBean(){ ... }
}
If AnnotationConfigApplicationContext
is used against first configuration class only (SomeClass
) I assume last configuration class (OtherClass
) should be processed as well. However the bean defined inside last configuration class doesn't exist in application context after initialization (refresh).
Some investigation showed that ConfigurationClassPostProcessor
is not invoked for OtherClass
therefore any annotations inside class never get processed.
Affects: 3.0 GA
Issue Links:
- INT-3207 Ensure Annotation Configuration support for Infrastructure components ("is depended on by")
- @Configuration imported via @ImportResource is not processed [SPR-11723] #16345
@Configuration
imported via@ImportResource
is not processed ("duplicates")
3 votes, 6 watchers