1. 程式人生 > >springcloud專案啟動不了,出現兩個bean

springcloud專案啟動不了,出現兩個bean

Description:

Field userFeign in com.yimao.cloud.order.controller.OrderController required a single bean, but 2 were found:

	
- feignBuilder: defined by method 'feignBuilder' in class path resource [com/hmily/tcc/springcloud/feign/HmilyRestTemplateConfiguration.class]
	

- feignHystrixBuilder: defined by method 'feignHystrixBuilder' in class path resource [org/springframework/cloud/sleuth/instrument/web/client/feign/TraceFeignClientAutoConfiguration.class]




Action:

Consider marking one of the beans as @Primary, updating the consumer to accept multiple beans, or using @Qualifier to identify the bean that should be consumed


Process finished with exit code 1


解決:

圖一:

圖二:

工作上遇到的問題:專案啟動不了,檢查是出現了兩個beanfactory建立兩個bean ,導致出錯,具體理解老大做了講解還在理解中。有大佬能有自己見解的可以評論一下,讓大家更好的學習!