异常:Caused by: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.qbb.srb.core.mapper.DictMapper.batchInsert
程序报错:Caused by: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.qbb.srb.core.mapper.DictMapper.batchInsert
今天使用mybatis出现了,第一反应是没扫描mapper包,然后去查看发现我写了.mapper目录结构如下
然后打开target-->classes查看我的xml文件根本没编译到mapper包中
解决办法:在pom.xml中加入如下的配置即可
<build>
<!-- 项目打包时会将java目录中的*.xml文件也进行打包 -->
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
</build>



浙公网安备 33010602011771号