问题:warning no match for this type name:xxx.xxx.xxx [Xlint:invalidAbsoluteTypeName]
原因:配置切面表达式有误
execution(<修饰符模式>? <返回类型模式> <方法名模式>(<参数模式>) <异常模式>?) 除了返回类型模式、方法名模式和参数模式外,其它项都是可选的。
如:execution(* com.idea4j.apollo.demo.service.*.*(..))
execution表示拦截方法,第一个“*”表示方法的返回值是任意的,第二个“*”包下的所有类,第三个“*”任意方法,(..)表示方法的参数是任意的
常见的切面表达式
1 所有公有方法的执行
execution(public * *(..))
2 所有以set开头的公有方法的执行execution(* set*(..))
3 AccountService接口下的所有方法的执行execution(* com.xyz.service.AccountService.*(..))
4 com.xyz.service包下的所有方法的执行execution(* com.xyz.service.*.*(..))
5 com.xyz.service包及其子包下的所有方法的执行execution(* com.xyz.service..*.*(..))
6 匹配com.xyz.service包下的所有类的所有方法(不含子包)within(com.xyz.service.*)
7 com.xyz.service包和子包的所有方法within(com.xyz.service..*)
8 匹配AccountService的代理类(不支持通配符)this(com.xyz.service.AccountService)
官方文档
https://docs.spring.io/spring/docs/4.2.5.RELEASE/spring-framework-reference/html/aop.html#aop-schema