首页 > 编程语言 > 详细

springboot整合mybatis 异常 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):

时间:2019-02-10 12:06:58      阅读:205      评论:0      收藏:0      [点我收藏+]

出现异常原因: 1.IDEA 编译时,没有将mapper.xml文件编译进去

        2.application.yml 文件没有指定 mapper.xml 的路径 

        正确配置

mybatis:
          mapperLocations: classpath*:club/wenfan/youtube/mapper/xml/*.xml
          type-aliases-package: club.wenfan.youtube.bean

pom.xml 中添加

<build>
        <resources>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.xml</include>
                </includes>
            </resource>
        </resources>
    </build>

两点缺一,都会处出现mapper.xml 文件找不到异常

springboot整合mybatis 异常 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):

原文:https://www.cnblogs.com/outxiao/p/10358967.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!