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): 以下圖java

 

報錯緣由mapper.xml 和 mapper接口綁定失敗 , mapper.xml  找不到apache

解決方法:在pom文件中指定文件加載tomcat

代碼:mybatis

<!-- 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>app

問題解決maven

相關文章
相關標籤/搜索