首页 > 解决方案 > 如何将接口加载为从黄瓜中的父模块自动装配的

问题描述

我能够加载所有父模块 applicationContext bean 定义。但是,当我@Autowired在其中一个接口上使用时,出现以下异常:

Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'automationUtils': Unsatisfied dependency expressed through field 'testClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.test.clients.testClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

任何人都可以在这方面提供帮助。

标签: javaspring-bootautowiredcucumber-java

解决方案


推荐阅读