前些天发现了一个巨牛的人工智能学习网站,通俗易懂,风趣幽默,忍不住分享一下给大家。点击跳转到教程。
报错如题: 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 引用时名字不一致,一个是大写,一个是小写。导入无法引用到。
改为统一名字就行了。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)