Hi,
I generated a simple Spring Boot 3.2.1 project using aop and web-services starters. Implemented some bean post processor (BPP) and custom advisor(AOP). When I run the project, I faced warnings mentioned below:
2024-01-17T23:49:39.628+04:00 WARN 19416 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'customConfiguration' of type [com.spring.example.demo.advisors.CustomConfiguration$$SpringCGLIB$$0] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [customBeanPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
2024-01-17T23:49:39.641+04:00 WARN 19416 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'advisorBean' of type [org.springframework.aop.aspectj.AspectJExpressionPointcutAdvisor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [customBeanPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
As far as I understand, there are no any explicit dependency between bean post processor and advisor that defined in the demo application.
Are there any suggestions about how best to tackle the problem and get off of the warnings?
The MRE you can find below: https://github.com/vaghav/spring-boot-warning-mre
Thanks a lot!
Comment From: jhoeller
This comes from the combination of a custom Advisor
bean and a custom BeanPostProcessor
, with the container trying to apply your custom Advisor
even to your BeanPostProcessor
(which leads to an implicit initialization dependency). In order to exclude the post-processor from auto-proxying, you could let it implement the AopInfrastructureBean
marker interface.
In general, such questions are better off at StackOverflow. This issue tracker is only meant for concrete bug reports and enhancement requests.
Comment From: bclozel
Already raised as spring-projects/spring-boot#39224
Comment From: vaghav
ok, thanks a lot, I found such questions have been already asked by other developers, that's why decided to rise it here to get complete answer. For example: https://github.com/spring-projects/spring-data-jpa/issues/3244 https://github.com/spring-projects/spring-boot/issues/38558 https://github.com/spring-projects/spring-integration/issues/3945
Neither of them pointed out to ask in StackOveflow...anyway, again, thank you.
Comment From: vaghav
This comes from the combination of a custom
Advisor
bean and a customBeanPostProcessor
, with the container trying to apply your customAdvisor
even to yourBeanPostProcessor
(which leads to an implicit initialization dependency). In order to exclude the post-processor from auto-proxying, you could let it implement theAopInfrastructureBean
marker interface.In general, such questions are better off at StackOverflow. This issue tracker is only meant for concrete bug reports and enhancement requests.
Thank you, much appreciated.