问题
报错信息如下:
***************************
APPLICATION FAILED TO START
***************************
Description:
A component required a bean of type 'com.example.project01.mapper.WordsMapper' that could not be found.
Action:
Consider defining a bean of type 'com.example.project01.mapper.WordsMapper' in your configuration.
大致的意思是:没有找到对应的mapper,需要在你的配置中添加一个mapper类型的bean
解决方法
试了各种方法,后来突然想到,有没有可能是springboot版本的问题,于是打开pom.xml文件,找到<parent>标签,果然发现默认使用的是3.0.6版本,如下:
但是我之前使用的是2.7.8版本,于是果断切换,然后更新一下pom文件依赖,项目就可以正常运行了!!!