springboot报错:expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

springboot Controller中引用

@Autowired
    private IXxxService xxxService;

 报错;expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

   解决:

XxxServiceImpl 前加 @Service 注解。

猜你喜欢

转载自www.cnblogs.com/webttt/p/12047828.html