今天在写代码的时候遇到这样一个问题:
Initialization of bean failed; nested exception is
java.lang.IllegalArgumentException:
warning no match for this type name:
com.wasu.test [Xlint:invalidAbsoluteTypeName]
根据上面描述,大概意思就是:AOP表达式错误,匹配失败。
然后我就查找了一些博客、看了看官方文档,终于找到了原因!
我原本写的表达式是:
@Around("execution(* com.xxx.xxx.service.*(..))")
后来改成这两个就可以正常运行了
@Around("execution(* com.xxx.xxx.service.*.*(..))")
@Around("execution(* com.xxx.xxx.service..*.*(..))")
报错的原因是: @Around("execution(* com.xxx.xxx.service.*(..))")
service.*(..)
这个表达式是有问题的,只匹配到了类,但没有匹配到类中的方法。
详细了解,请访问这个链接 execution(表达式)总结
文章如有错误,欢迎指出~希望能够帮到你!!!