好。我知道答案:
如果使用Spring的基于代理的AOP,@ Order注释可以正常工作。 对于加载时编织,需要声明方面优先级:
import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclarePrecedence; @Aspect @DeclarePrecedence("xxx.xxx.aop.SynchronizerAspect, org.springframework.transaction.aspectj.AnnotationTransactionAspect, *") public class AspectPrecedence { // empty }
要从AutoProxy(默认)切换到AspectJ:
@EnableAspectJAutoProxy @EnableTransactionManagement(mode = AdviceMode.ASPECTJ)