feign-client的值不唯一
报错内容如下:
***************************
APPLICATION FAILED TO START
***************************
Description:
Field warehouseFeign in com.rocwo.rwshop.controller.GoodsController required a bean of type 'com.rocwo.rwshop.warehouse.WarehouseFeign' that could not be found.
The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)
Action:
Consider defining a bean of type 'com.rocwo.rwshop.warehouse.WarehouseFeign' in your configuration.
Process finished with exit code 0
================================================================================================
这一句就代表着feign-client的值不唯一,解决办法如下:
1.先在启动类上加 @EnableFeignClients 注解
2.然后在配置文件中加入
spring: main: #解决@FeignClient值重复问题,解決重复bean allow-bean-definition-overriding: true