dubbo icon indicating copy to clipboard operation
dubbo copied to clipboard

DubboConfigEarlyInitializationPostProcessor cause PostProcessorRegistrationDelegate$BeanPostProcessorChecker log 'not eligible for getting processed by all BeanPostProcessors'

Open zhwq1216 opened this issue 5 years ago • 2 comments

  • [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));

zhwq1216 avatar Jul 24 '21 14:07 zhwq1216

i have the same problem, then how to fix it?

tcsp avatar Sep 18 '21 08:09 tcsp

fixed with #9397

CrazyHZM avatar Dec 17 '21 05:12 CrazyHZM