DubboConfigEarlyInitializationPostProcessor cause PostProcessorRegistrationDelegate$BeanPostProcessorChecker log 'not eligible for getting processed by all BeanPostProcessors'
- [x] I have searched the issues of this repository and believe that this is not a duplicate.
- [x] I have checked the FAQ of this repository and believe that this is not a duplicate.
Environment
- Dubbo version: 2.7.12
- Operating System version: centos7.4
- Java version: jdk1.8
Steps to reproduce this issue
Set the org.springframework log level to INFO, then there many logs such as:
INFO org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'xxx' of type [xxx.xxx.xxx] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
Tracking the org.springframework.context.support.PostProcessorRegistrationDelegate#registerBeanPostProcessors method, it is found that the postProcessorNames contains the instance of DubboConfigEarlyInitializationPostProcessor, and because DubboBeanConfigEarlyInitializationPostProcessor#initBeanFactory has been added to self to the beanPostProcessors list. Due to this BeanPostProcessor duplication, the beanProcessorTargetCount will be one more than the final beanPostProcessors list. Therefore, the above INFO log information is printed in org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.
String[] postProcessorNames = beanFactory.getBeanNamesForType(BeanPostProcessor.class, true, false);
// Register BeanPostProcessorChecker that logs an info message when
// a bean is created during BeanPostProcessor instantiation, i.e. when
// a bean is not eligible for getting processed by all BeanPostProcessors.
int beanProcessorTargetCount = beanFactory.getBeanPostProcessorCount() + 1 + postProcessorNames.length;
beanFactory.addBeanPostProcessor(new BeanPostProcessorChecker(beanFactory, beanProcessorTargetCount));
i have the same problem, then how to fix it?
fixed with #9397