spring boot aop拦截Controller失败

 java.lang.IllegalAccessError: tried to access class cn.xiaozhitech.controller.mode.Hello 
from class cn.xiaozhitech.controller.mode.HelloController$$FastClassBySpringCGLIB$$14914816]
 with root cause 
失败原因

-------------------------
@Aspect
@Component
public class ControllerLogAOP {

@Pointcut(value="execution(public * cn.xiaozhitech.service.mode.*.*(..))")  
    public void pointCuts(){} 
@Before("pointCuts")
public void before(){
System.out.println("success****************************************");
}
}
-----------------------------------
controller类
@RestController
public class HelloController {

@RequestMapping(value="/hello",consumes=MediaType.APPLICATION_JSON_VALUE,method=RequestMethod.POST)
@ResponseBody
public String hello(Integer i, @RequestBody Hello hello) throws IOException{

try {
helloService.getHello();
} catch (DataProcessException e) {
return e.getResponseString();
}

return JSON.toJSONString(hello);
}
}
-------------------
启动类
@SpringBootApplication
@EnableAspectJAutoProxy(exposeProxy=true)
public class Application {

public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}

你可能感兴趣的:(spring boot aop拦截Controller失败)