栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

Error creating bean with name ‘sqlSessionFactory‘ defined in class path resource [spring-dao.xml]

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Error creating bean with name ‘sqlSessionFactory‘ defined in class path resource [spring-dao.xml]

今天在做Spring和Mybatis整合到时候遇到的一个问题。。困扰了我很久。。。emmmmm

问题错误描述:

Error creating bean with name ‘sqlSessionFactory’ defined in class path resource [spring-dao.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.apache.ibatis.session.Configuration.setDefaultEnumTypeHandler(Ljava/lang/Class;)V

翻阅了别人写的解决方案

1.在mybatis配置文件和spring配置文件中都注册了同一个mapper,此时会出现报错,只要删掉mybatis中的配置mapper的部分就可以正常运行了。

2.spring配置标签中,把ref赋值错误的写成了value赋值,也会出现相同的错误,把value改回ref即可解决问题。

可是以上两步我都没有错误的!

我的解决方案

所以。。。emmm我的解决是。。。emmm
jar包版本的问题。。。。。。我原本用的mybatis-spring-2.0.7.jar就一直报这个错误,后面我换成了

删除2.0.7版本jar包

导入1.3.0版本的jar包

emmm就可以…运行了

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/839371.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号