调用方式
((EmployeeService) AopContext.currentProxy()).update(emp);
使用 切面调用方法时,报错
Cannot find current proxy: Set 'exposeProxy' property on Advised to 'true' to make it available.
解决方法(启动类上)
@EnableTransactionManagement(proxyTargetClass = true) //启注解事务管理,等同于xml配置方式的 <tx:annotation-driven />
@EnableAspectJAutoProxy(exposeProxy = true)