問(wèn)題
報(bào)錯(cuò)信息如下:
***************************
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.
大致的意思是:沒(méi)有找到對(duì)應(yīng)的mapper,需要在你的配置中添加一個(gè)mapper類型的bean文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-599886.html
解決方法
試了各種方法,后來(lái)突然想到,有沒(méi)有可能是springboot版本的問(wèn)題,于是打開pom.xml文件,找到<parent>標(biāo)簽,果然發(fā)現(xiàn)默認(rèn)使用的是3.0.6版本,如下:
但是我之前使用的是2.7.8版本,于是果斷切換,然后更新一下pom文件依賴,項(xiàng)目就可以正常運(yùn)行了!??!文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-599886.html
到了這里,關(guān)于運(yùn)行springboot出現(xiàn)“A component required a bean of type...that could not be found“問(wèn)題的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!