1. 程式人生 > >Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid b

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

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

 

最近在使用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

這裡寫圖片描述

原因是:在編輯的時候把mapper檔案給漏掉了 
這裡寫圖片描述

解決方法:修改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: 
這裡寫圖片描述