aop配置事务、通知遇到了这个问题
Caused by: java.lang.IllegalStateException: Cannot convert value of type 'com.sun.proxy.$Proxy8 implementing
Aspect.BookDao,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised,
org.springframework.core.DecoratingProxy' to required type 'Aspect.BookDaoImp' for property
'bookDao': no matching editors or conversion strategy found
java Spring默认使用jdk动态代理来实现AOP,但是
jdk动态代理的对象必须是有实现一个或多个接口的类。
如果要对没有实现接口的类的对象进行代理,则需要用到CGLIB代理。
那么在用xml配置aop时,需要在< aop:config >里面加上 proxy-target-class=“true”
即:
<aop:config proxy-target-class="true">
...
</aop:config>