ibatis.binding.BindingException: Invalid bound statement (not found)
前提:
1. mybatis的xml文件在resources/mapper路径下:
2. application.yml中mybatis相关配置如下:
mybatis: mapper-locations: classpath*:resources/mapper/*.xml
于是程序启动一旦调用数据库查询就出现了如下问题:
ibatis.binding.BindingException: Invalid bound statement (not found)
意思是mapper.java找不到对应的mapper.xml
别人的回答都是抄,所有的回答基本全TM一个样!
解决问题还是要靠自己!
查看target:
你会发现编译后的mapper.xml路径中,resources不见了,所以,把
mybatis: mapper-locations: classpath*:resources/mapper/*.xml
改为:
mybatis: mapper-locations: classpath*:mapper/*.xml
问题解决!
解决这个问题最重要的途径是看你的target中有没有这个.xml文件或其路径对不对!