expected at least 1 bean which qualifies as autowire candidate.

Java本地测试出错:

available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations
{@org.springframework.beans.factory.annotation.Autowired(required=true)}
	at
org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1509)

简单来说就是:找不到当前注入的bean

原因:@Service注解的包引入错误,

正确包

import org.springframework.stereotype.Service;

spring的注解,用于标注业务层组件(service) 

错误原因,引入包如下:

import com.alibaba.dubbo.config.annotation.Service;

dubbo用于声明provider的注解

你可能感兴趣的:(问题解决总结,Service注解,找不到bean)