没有类型的合格豆

时间:2019-06-25 18:42:05

标签: spring spring-boot

我无法使用Qualifier注释自动连接具有其名称的bean

这是针对Spring Boot 2.1.4

在项目A

@RestController
@ImportResource({"classpath*:config/CrudBeans.xml"})
public class WebCrudController extends BaseWebController 
                               interface RuleEngineExecutorI{

}

在项目B中

@Component("ruleEngineExecutor")
public class RuleEngineRestletExecutor extends WebCrudController  
                                       implements RuleEngineExecutorI {
}

在项目C中

@Autowired
@Qualifier("ruleEngineExecutor")
RuleEngineExecutorI webExecuteController;
  

项目C包含项目B的依存关系,而项目B包含一个         A的依赖

在项目C的应用程序类中

@SpringBootApplication(scanBasePackages={"com.A","com.B"})

我应该得到一个用RuleEngineRestletExecutor生成的bean,但我没有得到。相反,我得到了并且错误为

  

没有可用的'com.A.RuleEngineExecutorI'类型的合格Bean:预计至少有1个有资格作为自动装配候选的Bean

0 个答案:

没有答案