异常: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目录结构如下
image

然后打开target-->classes查看我的xml文件根本没编译到mapper包中
image

解决办法:在pom.xml中加入如下的配置即可

<build>
    <!-- 项目打包时会将java目录中的*.xml文件也进行打包 -->
    <resources>
        <resource>
            <directory>src/main/java</directory>
            <includes>
                <include>**/*.xml</include>
            </includes>
            <filtering>false</filtering>
        </resource>
    </resources>
</build>
posted @   我也有梦想呀  阅读(88)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
点击右上角即可分享
微信分享提示