网上搜了一下,结合了不同的解决方法后总结了一下
解决方法:
com.ideal.service.impl.UserServiceImpl实现的是com.ideal.service.interfaces.UserService接口,由于spring实现的是接口注入,关联的实现类。这里实现注入类,所以出现了异常。
在spring配置文件加入以下代码,实现类注入
<aop:config proxy-target-class="true"></aop:config>
之后又遇到问题:
Caused by: org.springframework.aop.framework.AopConfigException: Cannot proxy target class because CGLIB2 is not available. Add CGLIB to the class path or specify proxy interfaces.
解决方法:
导入cglib-nodep-2.1_3.jar包(不能是cglib-nodep-2.2.jar,或者导入asm-2.2.3.jar和cglib-2.2.jar )
OK,问题解决
对了,我用的是spring3.0.1
from : http://blog.sina.com.cn/s/blog_661dcaea01013k5x.html