例如:应用程序A-〉依赖项B. B获得了一个带@FeignClient注解的SPI接口,该接口由A和B中的类都依赖于@Autowired,当启动应用程序A时,SPI应该工作正常。在A的主类上添加@EnableFeignClients和@SpringBootApplication(scanBasePackages= "path-include-that-SPI-interface")并启动时,遇到异常"找不到限定的bean ...[SPI接口]"。
@FeignClient
@Autowired
@EnableFeignClients
@SpringBootApplication(scanBasePackages= "path-include-that-SPI-interface")
2w2cym1i1#
解决方案是为@EnableFeignClients配置扫描基本路径:@EnableFeignClients(basePackages= "path-include-that-SPI-interface").
@EnableFeignClients(basePackages= "path-include-that-SPI-interface")
1条答案
按热度按时间2w2cym1i1#
解决方案是为
@EnableFeignClients
配置扫描基本路径:@EnableFeignClients(basePackages= "path-include-that-SPI-interface")
.