0
点赞
收藏
分享

微信扫一扫

Request processing failed; nested exception is org.apache.ibatis.binding.BindingException,找不到mapper

晴儿成长记 2022-03-19 阅读 112

报错:HTTP Status 500 - Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): cn.sqnu.ssmbuild.mapper.BookMapper.selectAllBook

这个报错是说找不到对应的mapper.xml文件,可能是文件路劲问题。

解决方法一:

在resources中新建一个与mapper接口一样的包路径,然后把mapper.xml文件放进去

注意:我们这里需要建的是包结构,不是文件夹,由于resources不可以直接New包,但是我们可通过New文件夹的方式建包,具体操作如下:

 

解决方法二:

在pom.xml中添加以下代码:

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

举报

相关推荐

0 条评论