org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.jvtd.operation.lightCloud.product.mapper.ProductMapper.selectPagedProductList

看到这个错误,肯定是mybatis抛出的异常,意思是:mapper的xml文件没有selectPagedProductList这个方法,说说排查步骤

1.首先看下mapper.xml文件的中

<mapper namespace="com.jvtd.operation.auth.mapper.AuthFuncMapper"> 是否只想对应的mapper,这个地方我举例子用的是AuthFuncMapper

2.在看看mapper.xml文件中selectPagedProductList,这个方法相关resultMap还是resultType,

parameterType等是否正确

3.检查下xml文件是否被spring扫描到了,我是springboot的项目,

在application文件中配置的是

mybatis-plus.mapper-locations=classpath:classpath:com/jvtd/operation/lightCloud/*/mapper/xml/*Mapper.xml

我的问题是:mybatis-plus.mapper-locations=classpath:classpath:com/jvtd/operation/lightCloud/*/mapper/xml/*Mapper.xml有问题,xml没有被扫描到,犯这么低级的错误是因为,(之前的配置:classpath:com/jvtd/operation/*/mapper/xml/*Mapper.xm),*是代表很多包,那么同一层级所有包都是可以被扫描到的,但是,其中lightCloud下面有子包,就扫描不到了,最后改成了mybatis-plus.mapper-locations=classpath:com/jvtd/operation/*/mapper/xml/*Mapper.xml,classpath:com/jvtd/operation/lightCloud/*/mapper/xml/*Mapper.xml

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值