当前位置首页 > Apache知识

maven项目报错org.apache.ibatis.binding.BindingException:Invalidbound

阅读次数:395 次  来源:admin  发布时间:

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

maven项目报错org.apache.ibatis.binding.BindingException:Invalidboundstatement(notfound):

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

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

maven项目报错org.apache.ibatis.binding.BindingException:Invalidboundstatement(notfound):

代码:

lt;!-- tomcat插件 -->

lt;build>

lt;plugins>

lt;plugin>

lt;groupId>org.apache.tomcat.maven</groupId>

lt;artifactId>tomcat7-maven-plugin</artifactId>

lt;configuration>

lt;port>9003</port>

lt;path>/</path>

lt;/configuration>

lt;/plugin>

lt;/plugins>

lt;!-- 如果不添加此节点mybatis的mapper.xml文件都会被漏掉。 -->

lt;resources>

lt;resource>

lt;directory>src/main/java</directory>

lt;includes>

lt;include>**/*.properties</include>

lt;include>**/*.xml</include>

lt;/includes>

lt;filtering>false</filtering>

lt;/resource>

lt;!-- 指明加载resources -->

lt;resource>

lt;directory>src/main/resources</directory>

lt;includes>

lt;include>**/*.properties</include>

lt;include>**/*.xml</include>

lt;/includes>

lt;filtering>false</filtering>

lt;/resource>

lt;/resources>

lt;/build>

问题解决

上一篇:debian8.9KDE桌面如何设置自动登录
下一篇:【手把手教你全文检索】ApacheLucene初探