首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网络技术 > 网络基础 >

ssh-Cannot proxy target class because CGLIB2 is not available

2012-11-20 
ssh--Cannot proxy target class because CGLIB2 is not available解决方法:1.缺少CGlib,把CGLIB Jar包放

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接口)




热点排行