- mybatis spring application getting - org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
原因:
idea中将mapper类型是source,而xml文件在发布时不会编译,同时也不会发布到target中,导致项目运行时找不到mapper.xml文件。
解决方案:
在pom.xml的build中添加
<build>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*Mapper.xml</include>
</includes>
</resource>
</resources>
</build>