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的注解
更多推荐
已为社区贡献4条内容
所有评论(0)