org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)问题记录

在使用mybatis时,总会遇到各种奇怪问题,不胜枚举。

试过了网上大神总结的各种解决办法,namespace,id没有对上,没加@Mapper注解,还是不管用。最后回过头看看自己项目的配置,发现mapper-locations路径配置错了,而且是小细节的错误。如下是我的错误配置

mybatis-plus:
  mapper-locations: classpath:cn.suvue.discipline.modular.mapper.mapping/*.xml

我的路径前端部分写成了包路径的形式,肯定不对了

正确的格式如下:

mybatis-plus:
  mapper-locations: classpath:cn/suvue/discipline/modular/mapper/mapping/*.xml

这是我本人遇到的问题,细节决定成败,希望能帮到各位!


版权声明:本文为weixin_45612794原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。