AOP编程报错Xlint:invalidAbsoluteTypeName
@Component
@Aspect
public class DingdingAspect {
private Logger logger = LoggerFactory.getLogger(this.getClass());
@Pointcut("execution(* com.zhuanche.controller.driverteam.DriverTeamController.updateOneDriverTeam(..))&& @annotation(dingdingAnno)
")
public void pointCut(){
logger.info("含有自定义注解dingdingAnno的方法...");
}
@Before("pointCut()")
public void dingdingVerify(JoinPoint joinPoint ){
logger.info(joinPoint.getSignature().getName() + ",入参:{" + Arrays.asList(joinPoint.getArgs() + "}"));
}
@After("pointCut() && @annotation(dingdingAnno)")
//@AfterReturning("within(com.zhuanche.controller.driverteam(..)) && @annotation(dingdingAnno)")
public void finish(JoinPoint jointPoint,DingdingAnno dingdingAnno){
logger.info(jointPoint.getSignature().getName());
System.out.println(jointPoint.getSignature().getName());
}
}
想在某个方法前面加上自定义注解 方法成功后,做业务需求。结果一直报Xlint:invalidAbsoluteTypeName 。上网搜了下,一般是包或者类型错误。自己的原因是 后面加上了 && +自己的注解。这个应该是需要写在下面的 ,要不然spring 初始化的时候会认为这个目录找不到。