Spring AOP not working, when the method is called internally within a bean

后端 未结 3 2098
轻奢々
轻奢々 2020-11-29 09:36

I have several Aspects coded in my application. All others works except for the following.

Service Interface

package com.enbiso.proj         


        
3条回答
  •  孤城傲影
    2020-11-29 10:19

    You are running into a limitation of Spring AOP on self-invocation. You basically can get around it by using AopContext.currentProxy(), refactor code into different beans, or use full ApsectJ weaving.

    See explanation here and workaround(s). http://docs.spring.io/spring/docs/current/spring-framework-reference/html/aop.html#aop-understanding-aop-proxies

提交回复
热议问题