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);
}
}
Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐