maven项目 报错 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):

ssm的项目如果在mapper.xml  mapper接口 配置没问题的情况下  项目依然报org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): 如下图

maven项目 报错 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):

报错原因mapper.xml 和 mapper接口绑定失败 , mapper.xml  找不到

解决方法:在pom文件中指定文件加载

maven项目 报错 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):

代码:

<!-- tomcat插件 -->
<build>
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<configuration>
<port>9003</port>
<path>/</path>
</configuration>
</plugin>
</plugins>
<!-- 如果不添加此节点mybatis的mapper.xml文件都会被漏掉。 -->
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>false</filtering>
</resource>
<!-- 指明加载resources -->
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
</build>

问题解决

上一篇:mysql 截取字符串 函数


下一篇:python之路第五篇之模块和加密算法(进阶篇:续)