这是个小错误也是个蠢错误...

翻译一下报错:

org.apache.ibatis.binding.bindingException:绑定语句无效(未找到)

也就是在mybatis中dao层xxxMapper接口与xxxMapper.xml文件在做映射绑定的时候出现问题,也就是xxxMapper接口无法匹配到操作sql语句的方法id~

解决:

1.检查xml映射文件中<mapper>标签绑定包名地址是否正确(即namespace的值)

mybatis-plus报错解决:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

2. 检查xxxMapper接口中的方法,对应xml映射文件中是否有

mybatis-plus报错解决:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

 mybatis-plus报错解决:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

上图这两者必须对应~

3.检查<select>标签中的resultType是否与xxxMapper接口中的方法返回值类型一致,若一个是对象一个是集合,那也会报错~

4.检查yml配置文件中的mybatis配置

mybatis-plus报错解决:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

我蠢在用了mybatis-plus框架配置还写着mybatis....血泪教训 = =

以上就是常见的解决方案,总有一个适合你犯的错误,哈哈~

 

 

 

 

 

 

 

 

 

 

相关文章:

  • 2022-02-04
  • 2021-11-01
  • 2022-12-23
  • 2021-08-05
  • 2021-12-09
  • 2022-12-23
  • 2021-07-08
  • 2021-11-28
猜你喜欢
  • 2022-12-23
  • 2021-06-05
  • 2022-12-23
  • 2021-11-24
  • 2021-04-19
  • 2021-05-03
相关资源
相似解决方案