org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.easyjava.mapper

在idea单元测试中遇到org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.easyjava.mappers.CourseMapper.selectList报错,如下图

 我试过很多方法之后发现是mapper的配置路径不对:

当路径相同的时候是可以不用配置mapper-locations的,但是我对了我的路径名称是一致的,但我在application.properties配置完mapper-locations又可以正常运行了

配置代码

mybatis.mapper-locations=classpath:com.easyjava.mappers/*Mapper.xml

 这样就问题就解决了

猜你喜欢

转载自blog.csdn.net/weixin_57997644/article/details/132185904
今日推荐