Mybatis笔记一:java.lang.NoClassDefFoundError: org/apache/ibatis/mapping/DatabaseIdProvider
发布日期:2021-08-30 20:31:05 浏览次数:2 分类:技术文章

本文共 881 字,大约阅读时间需要 2 分钟。

异常错误:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [test1-jdbc.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/ibatis/mapping/DatabaseIdProvider

浪费我一定时间,终于找到原因解决!

原因:Mybatis和Spring整合出现错误,二者之间版本不匹配

修改之前:

       <dependency>

            <groupId>org.mybatis</groupId>
            <artifactId>mybatis-spring</artifactId>
            <version>1.2.2</version>
        </dependency>
        <dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis</artifactId>
            <version>3.0.6</version>
        </dependency>

修改之后:

       <dependency>

            <groupId>org.mybatis</groupId>
            <artifactId>mybatis-spring</artifactId>
            <version>1.2.2</version>
        </dependency>
        <dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis</artifactId>
            <version>3.2.8</version>
        </dependency>

转载于:https://www.cnblogs.com/sishang/p/6550829.html

转载地址:https://blog.csdn.net/weixin_34050005/article/details/94041642 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:汉化Git Gui
下一篇:【2012百度之星资格赛】G:聊天就是Repeat

发表评论

最新留言

感谢大佬
[***.8.128.20]2024年03月28日 21时35分21秒