记录A component required a bean named ‘studentService‘ that could not be found.
生活随笔
收集整理的這篇文章主要介紹了
记录A component required a bean named ‘studentService‘ that could not be found.
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
??
前些天發現了一個巨牛的人工智能學習網站,通俗易懂,風趣幽默,忍不住分享一下給大家。點擊跳轉到教程。
報錯如題: ?A component required a bean named 'studentService' that could not be found.
出問題的代碼行:
<dubbo:service layer="biz" interface="com.service.rpc.api.StudentService" ref="studentService" protocol="dubbo" group="xmlConfig"/>?
出錯的地方:
ref="studentService"?
出錯原因:報錯時在service實現類上注解寫的是?
?
@Service("StudentService")?
?
@Service("StudentService") public class StudentServiceImpl implements StudentService {?
?
如上代碼和 dubbo 引用時名字不一致,一個是大寫,一個是小寫。導入無法引用到。
改為統一名字就行了。
?
總結
以上是生活随笔為你收集整理的记录A component required a bean named ‘studentService‘ that could not be found.的全部內容,希望文章能夠幫你解決所遇到的問題。