Invalid bound statement (not found): com.example.demo.dao.UserDao.login
Springboot项目报Invalid bound statement (not found): com.example.demo.dao.UserDao.login错误的原因及解决方法1.问题截图2.问题分析根据报错信息推断是无法扫描到mapper文件(就是dao层的接口文件和xml文件),引起该情况因素一般有几种:注解问题,yml文件配置问题没有在dao层的接口上添加注解@Mapper没有在
·
Springboot项目报Invalid bound statement (not found): com.example.demo.dao.UserDao.login错误的原因及解决方法
1.问题截图
2.问题分析
根据报错信息推断是无法扫描到mapper文件(就是dao层的接口文件和xml文件),引起该情况因素一般有几种:注解问题,yml文件配置问题
没有在dao层的接口上添加注解@Mapper
没有在启动类上加注解@MapperScan(value = “com.example.demo.dao”)
service层没有写@Service注解,引入dao层接口上没有写@Autowired注解
注解都添加了还是没解决,看看yml文件是否配置了mybatis的mapper文件路径
然后看看mapper文件内容是否有问题,这里以我的为例
我因为yml文件配置mybatis路径错误导致的这个错误,常规的解决方法就这些,希望能帮到你
更多推荐
已为社区贡献6条内容
所有评论(0)