spring 报错:.NoSuchBeanDefinitionException

发布时间:2020-07-09 17:58:10 作者:沙漏半杯
来源:网络 阅读:2516

ror creating bean with name 'alarmController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: cn.yjxxclub.shijie.service.AlarmService cn.yjxxclub.shijie.controller.AlarmController.alarmService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [cn.yjxxclub.shijie.service.AlarmService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}


解决:


1 spring.xml文件中没有扫描到service


2 service 中没有@Service注解


推荐阅读:
  1. Spring容器以及spring ioc原理介绍
  2. Spring BeanFactory

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

spring java 互联网

上一篇:spring boot redis

下一篇:如何设置CSS表格边框间的距离及border-spacing属性的使用方法

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》