Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'XXX' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
报错之前是这样写的
![](https://i-blog.csdnimg.cn/blog_migrate/71df0cd069c7f552fad7c49d9dc584b2.png)
@Service 注解写在 service 实现类上就成功运行了
![](https://i-blog.csdnimg.cn/blog_migrate/ecec1714bc97c852f45830905bf12941.png)