单元测试报错:org.apache.ibatis.binding.BindingException Caused by: java.lang.IllegalArgumentException:

1、我的问题出现在使用springBoot 3.*版本,对应mybatisplus3.5.3版本,在单元测试时,出现
 

org.apache.ibatis.binding.BindingException

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): xxxMapper.insert
    at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:229)
    at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:53)
    at org.apache.ibatis.binding.MapperProxy.lambda$cachedInvoker$0(MapperProxy.java:96)
    at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708)
    at org.apache.ibatis.util.MapUtil.computeIfAbsent(MapUtil.java:36)
    at org.apache.ibatis.binding.MapperProxy.cachedInvoker(MapperProxy.java:94)
    at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:86)
    at jdk.proxy2/jdk.proxy2.$Proxy62.insert(Unknown Source)
    at com.baomidou.mybatisplus.extension.service.IService.save(IService.java:63)
  //...
    at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:53)

其实出现这种情况跟多是版本冲突

所以,我的解决(改了2个小时,所有方法都试了,就改版本有效)

如果出现类似,先clean,对加载内容清理,springboot版本3.0降低或者将mybatisplus版本提高最新。目前最新mybatisplus3.5.7

亲测有效!!!!!!!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值