I have the following Spring AOP advice and I can\'t find out why it is called twice:
@Component
@Aspect
public class LoggingAspects {
Logger logger = Lo
1. hint
Do you use JavaConfig or xml? If you're using both, it could be that the Aspect is being processed two times by the Spring IoC container.
2. hint
I don't annotate aspects with @Component annoation, try to remove it, maybe because of that is being processed twice by Spring.
I found that the advice can be called twice if the aspect is declared as request-scoped. In this case the same bean is registered twice as an interceptor with different names: someAspect
and scopedTarget.someAspect
. I solved this issue by making the Aspect a singleton.
Version: Spring Boot 2.0.x