1.Cannot find current proxy: Set 'exposeProxy' property on Advised to 'true' to make it available.
解决方法:在配置文件中添加
1 <aop:aspectj-autoproxy expose-proxy="true"/> 2 <bean class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator"> 3 <property name="proxyTargetClass" value="true"/> 4 </bean>
pom.xml中添加aop相关jar包
1 <dependency> 2 <groupId>org.springframework</groupId> 3 <artifactId>spring-aop</artifactId> 4 <version>${spring.version}</version> 5 </dependency> 6 7 <dependency> 8 <groupId>org.springframework</groupId> 9 <artifactId>spring-aspects</artifactId> 10 <version>${spring.version}</version> 11 </dependency>