Skip to content

Bean 'x' of type [y] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) #32055

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
vaghav opened this issue Jan 18, 2024 · 4 comments
Labels
status: invalid An issue that we don't feel is valid

Comments

@vaghav
Copy link

vaghav commented Jan 18, 2024

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!

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jan 18, 2024
@jhoeller
Copy link
Contributor

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.

@jhoeller jhoeller added status: invalid An issue that we don't feel is valid and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jan 18, 2024
@bclozel
Copy link
Member

bclozel commented Jan 18, 2024

Already raised as spring-projects/spring-boot#39224

@vaghav
Copy link
Author

vaghav commented Jan 18, 2024

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:
spring-projects/spring-data-jpa#3244
spring-projects/spring-boot#38558
spring-projects/spring-integration#3945

Neither of them pointed out to ask in StackOveflow...anyway, again, thank you.

@vaghav
Copy link
Author

vaghav commented Jan 18, 2024

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.

Thank you, much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

4 participants