执行的方面 class 不正确 Spring 基于 AOP 架构

Incorrect aspect class is executed Spring AOP Schema Based

//纵横比-config.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
    xsi:schemaLocation="
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd">

    <bean name="referenceAspect"
        class="com.example.reference.audit.aspect.ReferenceAuditAspect"></bean>
    <bean name="mainApplicationTypeAspect"
        class="com.example.maintenance.audit.aspect.MaintApplicationTypeAuditAspect"></bean>

    <aop:aspectj-autoproxy proxy-target-class="true" />
    <aop:config>
        <aop:aspect ref="referenceAspect">
            <!-- @around sysad log annotation -->
            <aop:pointcut id="referencePointCut" expression="@annotation(etisLog)" />
            <aop:around method="auditLogAround" pointcut-ref="referencePointCut" />
        </aop:aspect>

        <aop:aspect ref="mainApplicationTypeAspect">
            <!-- @around sysad log annotation -->
            <aop:pointcut id="mainApplicationTypePointCut" expression="@annotation(etisLog)" />
            <aop:around method="auditLogAround" pointcut-ref="mainApplicationTypePointCut" />
        </aop:aspect>

    </aop:config>

</beans>  

我有两个方面class:

@Component
public class ReferenceAuditAspect {


  public Object auditLogAround(ProceedingJoinPoint joinPoint, ETISLog etisLog)
      throws Throwable {
    LOGGER.info("INTERCEPTING REFERENCE SERVICE...");
  }
}

@Component
public class MaintApplicationTypeAuditAspect  {


  public Object auditLogAround(ProceedingJoinPoint joinPoint, ETISLog etisLog)
      throws Throwable {
    LOGGER.info("INTERCEPTING REFERENCE SERVICE...");

  }

}

//我的切入点表达式

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface ETISLog {

}

//在API级别拦截

@ETISLog
  public ResponseEntity<MaintApplicationType> save(
      @RequestBody MaintApplicationType maintApplicationType) {
    LOGGER.info("API: SAVE {}", maintApplicationType);

    return new ResponseEntity<>(maintApplicationTypeService.save(maintApplicationType),
        HttpStatus.CREATED);
  }

但是为什么当我 运行 我的应用程序在 maintApplicationApi 下执行保存操作时,总是执行的方面是 ReferenceAuditAspect 而不是 mainApplicationTypeAspect。我在 auditLogAround 中有一个执行特定操作的代码。

我遵循了此处的文档:https://docs.spring.io/spring/docs/4.0.x/spring-framework-reference/html/aop.html -> 8.3 部分

我也尝试删除:<aop:aspectj-autoproxy proxy-target-class="true" /> 但同样的问题

我的解决方法是为每个方面创建一个新的切入点表达式注释。