问题描述:
在使用aspectJ申明事务管理时出现的异常
org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'accountServiceImpl' must be of type [com.spring.demo4.AccountServiceImpl],but was actually of type [com.sun.proxy.$Proxy18]
解决方法:
出现该异常是由于使用了默认的jdk的自动动态代理,需要在<aop:aspectj-autoproxy中添加proxy-target-class="true" 如下:<aop:aspectj-autoproxy proxy-target-class="true"/> ,即表示使用AspectJ的支持。
更多推荐
使用spring遇到"BeanNotOfRequiredTypeException......but was actually of type [co
发布评论