SpringBoot 启动时,报错 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): c


报错图示:

 报错原因:UserMapper.xml 没有在配置文件中配置,SpringBoot 找不到

解决:

application.yml 中添加下述配置:

mybatis:
mapper-locations: classpath:mapper/*.xml #扫描所有 mybatis 的 xml 文件