Closed
Description
Henryk Konsek opened SPR-7868 and commented
I created simple bean implementing BeanDefinitionRegistryPostProcessor. All I want to do is to register some bean definition in the BeanDefinitionRegistryPostProcessor#postProcessBeanDefinitionRegistry method. The problem is that code working with ClassPathXmlApplicationContext doesn't work with AnnotationConfigApplicationContext.
My intelligent guess would be that BeanDefinitionRegistryPostProcessor#postProcessBeanDefinitionRegistry is called after JavaConfig bean postprocessor.
I'm attaching minimal Maven project with two unit tests (XmlTest & AnnotationTest) to demonstrate the issue.
Affects: 3.0.5
Attachments:
- registryBug.zip (23.00 kB)
Issue Links:
- Method postProcessBeanDefinitionRegistry is not called if the bean implements BeanDefinitionRegistryPostProcessor [SPR-9464] #14099 Method postProcessBeanDefinitionRegistry is not called if the bean implements BeanDefinitionRegistryPostProcessor ("is duplicated by")
- BeanFactoryPostProcessor breaks default post-processing of @Configuration classes [SPR-8269] #12917 BeanFactoryPostProcessor breaks default post-processing of
@Configuration
classes - Allow BeanDefinitionRegistryPostProcessor to register other BeanDefinitionRegistryPostProcessors [SPR-10630] #15258 Allow BeanDefinitionRegistryPostProcessor to register other BeanDefinitionRegistryPostProcessors