advancedSpring Internals — Bean Lifecycle & Proxies

How can a custom FactoryBean accidentally bypass Spring AOP proxy creation?

AOP proxies are normally applied via BeanPostProcessor around the OBJECT a bean definition produces. If a FactoryBean's getObject() constructs and returns its target manually instead of going through the full Spring-managed creation path, the proxy-creation BeanPostProcessors may never get a chance to wrap it.

Ready to master this question?

Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.

Sign in to generate a response

Next Step

Continue to Why does a manually instantiated bean (new MyService()) never receive dependency injection or AOP advice?← Back to all Spring Boot & Microservices questions