Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
BeanPostProcessor won't ever get proxied bean in case of circular references in the bean [SPR-13163] #17754
BeanPostProcessors will obtain reference to unwrapped bean instead of proxy class that handles (for example) transaction attributes of the bean. This happens only for beans that have circular bean references in them.
Steps to reproduce:
One of the beans will come as proxy to the post processor, the other one in unwrapped shape. This happens despite of BeanFactory has both beans in singletons repository proxied.
Workaround for this bug is to pass BeanFactory to the BeanPostProcessor class and do this: