Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid b

时间:2021-11-09 19:22:36

Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid b

 
版权声明:本文为博主原创文章,未经博主允许不得转载。来源 https://blog.csdn.net/xiaozhegaa/article/details/76569821

最近在使用Maven+SSM整合开发分模块分布式的时候,出现了以下的错误

Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
com.taotao.mapper.TbItemMapper.selectByExample
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:978)
  • 1
  • 2
  • 3

Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid b

原因是:在编辑的时候把mapper文件给漏掉了 
Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid b

解决方法:修改tmapper模块的pom文件 
在pom文件中添加如下内容:

<!-- 如果不添加此节点mybatis的mapper.xml文件都会被漏掉。 -->
    <build>
        <resources>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.properties</include>
                    <include>**/*.xml</include>
                </includes>
                <filtering>false</filtering>
            </resource>
        </resources>
    </build>

测试OK: 
Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid b