随笔(十九)『org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)』

1、错误信息:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

出现此错误时:
	1、除了查看代码上的各种名称,映射之类能否找到外。
	2、查看下target中是否有对应的xml文件,因为maven默认是不会把非resource中的xml打包进target的
	3、如果.xml文件放在java目录且与mapper接口不在同一级
	
解决方案:1、pom.xml
    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
                <includes>
                    <include>**/*</include>
                </includes>
            </resource>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.xml</include>
                </includes>
            </resource>
        </resources>
    </build>

	2、配置文件
	mybatis-plus:
		mapper-locations: classpath:com/...对应的文件
posted @   小昕昕  阅读(17)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
点击右上角即可分享
微信分享提示