版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_32360995/article/details/89011561
问题:
在某学习网站上学习Spring Boot,在使用Mybatis-xml实现持久层支持时,出现错误:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.how2java.springboot.mapper.CategoryMapper.findAll
解决:
使用IDEA开发时,如果打包时*Mapper.xml没有自动复制到class输出目录的mapper类包下,则需要在pom文件中添加mybatis加载配置文件的配置!
参考博客:https://blog.csdn.net/oMrLeft123/article/details/70239951
<build>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
</build>