In a @Configuration configuration class, when injecting a class that implements the BeanDefinitionRegistryPostProcessor interface (@Bean mode), the configuration class cannot generate a dynamic proxy.

Comment From: kse-music

you can use static modifier

@Bean public static BRP ...

Comment From: sbrannen

As stated in the Javadoc for @Bean:

BeanFactoryPostProcessor-returning @Bean methods

Special consideration must be taken for @Bean methods that return Spring BeanFactoryPostProcessor (BFPP) types. Because BFPP objects must be instantiated very early in the container lifecycle, they can interfere with processing of annotations such as @Autowired, @Value, and @PostConstruct within @Configuration classes. To avoid these lifecycle issues, mark BFPP-returning @Bean methods as static.

@yyq-lm, is your @Bean method for your BeandefinitionRegistryPostprocessor declared as static as @kse-music suggested?

Comment From: spring-projects-issues

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Comment From: spring-projects-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.