??
前些天發現了一個巨牛的人工智能學習網站,通俗易懂,風趣幽默,忍不住分享一下給大家。點擊跳轉到教程。
報錯如題: ?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 引用時名字不一致,一個是大寫,一個是小寫。導入無法引用到。
改為統一名字就行了。
?