在结合mybatis-plus的SpringBoot项目中,访问url,出现异常: BindingException: Invalid bound statement (not found)
出现异常:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
MVC层都没有报错
很大可能就是根本找不到 .xml文件在哪里。
解决方式
在全局配置文件application.properties 中,配置.xml的位置
mybatis-plus.mapper-locations=classpath:/mapper/*.xml
如果是结合mybatis的SpringBoot项目可以配置下面代码:
mybatis.mapper-locations=classpath:/mapper/*.xml
之后就可以正常获取到.xml文件了。