java.lang.ClassCastException: com.sun.proxy.$Proxy* cannot be cast to***

Spring AOP 有两种代理方法,

一种是常规JDK,一种是CGLIB。

当代理对象实现了至少一个接口时,默认使用JDK动态创建代理对象;

当代理对象没有实现任何接口时,就会使用CGLIB方法。

如果实现了接口,强制转换必须用父类接口来定义

原文地址:https://www.cnblogs.com/shiysin/p/10346840.html