service 无法注入bean问题

No qualifying bean of type 'com.unqd.api.weituo.service.IamCustomerService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

问题原因:

1、接口不存在实现,找不到实现类

2、该接口存在多个实现类,找不到需要注入的实现类

3、接口的实现类被 abstract 修饰,不是最终的子类,必须被继承。(自己犯的错误)

4、springBoot 启动类,没有包扫描注解,或者注解有误

你可能感兴趣的:(service 无法注入bean问题)