IDEA中SpringBoot項目找不到接口Consider defining a bean of type com.xxxx.xxx.xxx in your configuration

  • 【版權所有,文章允許轉載,但須以鏈接方式註明源地址,否則追究法律責任】

報錯信息

***************************
APPLICATION FAILED TO START
***************************
Description:

A component required a bean of type ‘com.bdqn.dao.GradeleDao’ that could not be found.

Action:

Consider defining a bean of type ‘com.bdqn.dao.GradeleDao’ in your configuration.
在這裏插入圖片描述

報錯原因

  • 因爲我之前SpringBoot主加載類報錯,
  • 不下載依賴, 所以百度加了這個圖中紅筆圈住的括號,
  • 導致我整整一天項目找不到接口,百思不得其解,
  • 最後終於發現是它搞的鬼,原因目前還沒搞清楚
  • 如果你也是找不到接口可以試一下把這個註釋掉,
  • 註釋掉之後項目成功運行,沒有報錯!

最後我建議SpringBoot項目還是不要用jsp了,最好還是用thymeleaf的模板,用法就是在html表頭加一句話

<html lang="en" xmlns:th="http://www.thymeleaf.org">

在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章