org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'cn.yang.service.StudentInterface' available: expected at least 1 bean which qualifies as autowire candidate


最近配置一个ssm的工程遇上了一个问题:

org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'cn.xxxx.service.StudentInterface' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

经过长达1个小时的排查,终于解决了(汗颜!!!!!!!!!!!!)

首先:

1.查看applicationContext.xml 文件是否开启自动扫描或者是否注入了bean

  建议可以用手动配置的方式注入bean 看是自动注入的问题还是接口的问题

2.查看@Autowired 注入的bean 是否写错

  

3.查看接口的实现类是否实现了改接口.

 

4.查看@service注解是否有写.....

我的就是@service注解没写,主要是以前没写,也没问题..所以一下子没想到这个问题....


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



猜您在找 Caused by:org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type "" available: expected at least 1 bean which qualifies as autowire candidate Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.thinkplatform.dao.UserLogDao' available: expected at least 1 bean which qualifies as autowi No qualifying bean of type 'org.springframework.mail.javamail.JavaMailSender' available: expected at least 1 bean which qualifies as autowire candidate springboot启动报错:Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.zxkj.lockserver.dao.CompanyDao' available: expected at least 1 bean which qua NoSuchBeanDefinitionException: No qualifying bean of type 'com.bj186.ssm.mapper.EmployeeMapper' available: expected at least 1 bean which qualifies as autowire candidate No qualifying bean of type '***' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: org.springframework.beans.factory.NoSuchBeanDefinitionException:No qualifying bean of type 'xxx 'available No qualifying bean of type vailable: expected at least 1 bean which qualifies as autowire springboot available: expected at least 1 bean which qualifies as autowire candidate springboot报错:expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM