org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.***

SSM框架运行时报该错误,提示找不到dao的映射文件,一直以为是文件路径配置的问题,如图:

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.***

spring-mybatis.xml配置

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.***

最终发现路径配置并没有问题,然后看了下编译后的class文件,发现原来是编译器没有编译XML文件,如图

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.***

最终解决方案,向pom中添加如下配置成功运行

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