问题解决:Invalid bound statement (not found): com.jxgm.csz.mapper.UserMapper.add

话不多说,一下是错误

 

问题解决:Invalid bound statement (not found): com.jxgm.csz.mapper.UserMapper.add

问题有二

一 、在整合SSM框架时, mapper 文件和接口文件名必须一致。但整合SM(Mybatis 、spring)则不需要。

错误:  问题解决:Invalid bound statement (not found): com.jxgm.csz.mapper.UserMapper.add     正确: 问题解决:Invalid bound statement (not found): com.jxgm.csz.mapper.UserMapper.add

 

二、在整合SSM框架时,还会出现mapper.xml文件没有的情况。

问题解决:Invalid bound statement (not found): com.jxgm.csz.mapper.UserMapper.add

出现这种情况,你需要再注意另外两种情况。

1.在MyEcilpse(或eclipse)中,你只要把项目重新挂上去就行了。一定要挂上去,不是重启服务器。文件就能出现了。

2.在使用IntelliJ idear编译的Maven项目中,你需要配置pom.xml文件,最后clean下就行了。

<!-- 如果不添加此配置,mybatis的mapper.xml文件都会被漏掉 -->
  <build>
           <resources>
                <resource>
                   <directory>src/main/java</directory><!--所在的目录-->
                   <includes><!--包括目录下的.properties,.xml文件都会扫描到-->
                     <include>**/*.properties</include>
                      <include>**/*.xml</include>
                   </includes>
                   <filtering>false</filtering>
                </resource>               
           </resources>
  </build>