一、spring cloud 使用 feign 啓動報錯 spring
錯誤信息ide
org/springframework/cloud/client/loadbalancer/LoadBalancedRetryFactory
緣由:jar包衝突問題,code
解決方法:在pom.xml 修改下引入規則xml
<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-openfeign</artifactId> <exclusions> <exclusion> <artifactId>spring-cloud-openfeign-core</artifactId> <groupId>org.springframework.cloud</groupId> </exclusion> </exclusions> </dependency>
二、spring boot自動注入出現blog
Consider defining a bean of type 'xxx' in your configurationit
緣由:@Component,在默認狀況下只能掃描與控制器在同一個包下以及其子包下的@Component註解,以及能將指定註解的類自動註冊爲Bean的@Service@Controller和@ Repository,因此須要在啓動類上加上未找到類的位置,手動去掃描該包下的類,加上註解@ComponentScan便可io
@ComponentScan(basePackages = "com.xxx.xxx.xxx")
三、class