原因,没有导入aop包。加入相关依赖,即可
<dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjweaver</artifactId> </dependency>