spring 报错:.NoSuchBeanDefinitionException
导读:本文共570字符,通常情况下阅读需要2分钟。同时您也可以点击右侧朗读,来听本文内容。按键盘←(左) →(右) 方向键可以翻页。
摘要: ror creating bean with name 'alarmController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not auto... ...
目录
(为您整理了一些要点),点击可以直达。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注解
spring 报错:.NoSuchBeanDefinitionException的详细内容,希望对您有所帮助,信息来源于网络。