`
kevin.wang
  • 浏览: 243569 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

ssh--Cannot proxy target class because CGLIB2 is not available

阅读更多
解决方法:
1.缺少CGlib,把CGLIB Jar包放入项目就可以了.

2. 没有实现任何接口的时候也会报这个错误!

注:cglib不包含asm,cglib-nodep包含了asm,而asm是cglib必须的三方类库,出现两个版本的原因恐怕是要避免框架集成时的版本冲突吧。

======================================================================
Cannot convert value of type [$Proxy0 implementing org.springframework.beans.factory.InitializingBean,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [dao.UserDaoImp] for property 'userDao': no matching editors or conversion strategy found

就异常显示的信息可以看到,Spring在转换时,主要是将代理类转换成接口,而不能转换成实际类。

解决办法:
1.如果在Spring配置文件中配置的事务是通过AOP标签实现的,那就在<aop:config />中增加proxy-target-class="true"属性。
2.使实际的类实现某个接口(UserDaoImp实现UserDao接口)




分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics