Skip to content
Advertisement

Tag: spring-aop

Accessing spring bean proxy reference itself

I have an issue with @Cacheable and @CacheEviction annotations. When I call these methods in the bean where they are declared, the aop part is not getting executed. The underlying reason for this is that the bean access to its own instance itself, instead of accessing the spring proxy. I have read this question where it is said that in

Spring AOP Advice Called Twice

For some reason, my Spring AOP advices are being called twice. I checked: Spring AOP advice is called twice but I am not using the Component annotation, and am declaring the aspect bean once and annotating it with @Aspect and that’s it. Somewhat belatedly I realized that one of my classes was not implementing an interface yet, which caused CGLIB2

Advertisement