spring 报错:.NoSuchBeanDefinitionException(java,spring,互联网,编程语言)

时间:2024-05-02 13:54:07 作者 : 石家庄SEO 分类 : 编程语言
  • TAG :

    spring+%E6%8A%A5%E9%94%99%EF%BC%9A.NoSuchBeanDefinitionException

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的详细内容,希望对您有所帮助,信息来源于网络。
上一篇:php中copy()能拷贝目录吗下一篇:

3 人围观 / 0 条评论 ↓快速评论↓

(必须)

(必须,保密)

阿狸1 阿狸2 阿狸3 阿狸4 阿狸5 阿狸6 阿狸7 阿狸8 阿狸9 阿狸10 阿狸11 阿狸12 阿狸13 阿狸14 阿狸15 阿狸16 阿狸17 阿狸18