mybatis-plus报错解决Invalid bound statement (not found)错误
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): XXMapper.findTagList
也就是在mybatis中dao层xxxMapper接口与xxxMapper.xml文件在做映射绑定的时候出现问题,也就是xxxMapper接口无法匹配到操作sql语句的方法id~
首先断点打在调用mapper方法的地方
tagMapper.findTagList();
继续走,进入MapperMethod.java类:
问题就在这里 ,mappedStatements没有工程的mapper,原因就是没有扫描到,即定位到扫描时配置问题!
-
检查xml映射文件中
-
检查xxxMapper接口中的方法,对应xml映射文件中是否有
-
检查 标签中的resultType是否与xxxMapper接口中的方法返回值类型一致,若一个是对象一个是集合,那也会报错~
-
检查yml配置文件中的mybatis配置
配置项 mybatis -> mybatis-plus
mybatis-plus: mapper-locations: classpath*:com/xxx/*Mapper.xml typeAliasesPackage: com.xxx.entity
- xml资源配置
maven:
gradle:
问题解决!
Original: https://www.cnblogs.com/owenma/p/14570765.html
Author: 森林木马
Title: mybatis-plus报错解决Invalid bound statement (not found)错误
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/543393/
转载文章受原作者版权保护。转载请注明原作者出处!