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的注解
版权声明:本文为tec_1535原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。