Invalid bound statement (not found)

报这个错,请检测以下步骤:

  • mapper.xml的namespace要写所映射接口的全称类名。

  • mapper.xml中的每个statement的id要和接口方法的方法名相同

  • mapper.xml中定义的每个sql的parameterType要和接口方法的形参类型相同

  • mapper.xml中定义的每个sql的resultType要和接口方法的返回值的类型相同

  • mapper.xml要和对应的mapper接口在同一个包下

  • mapper.xml的命名规范遵守: 接口名+Mapper.xml

然而我的问题是:

mybatis:
  mapper-locations: classpath:/mapper/BookMapper.xml

居然少写了个s,写成了

mapper-location,找了快两天,这个错就是找不到与接口相应的mapper.xml

参考springboot整合mybaits 文章:
原文地址:https://www.cnblogs.com/smiler/p/9983401.html