Framework/Spring Boot

[Error] No Feign Client for loadBalancing defined. Did you forget to include spring-cloud-starter-loadbalancer?

잔망루피 2024. 4. 28. 05:29
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.sieum.batch.feign.MusicFeignClient': Unexpected exception during bean creation; nested exception is java.lang.IllegalStateException: No Feign Client for loadBalancing defined. Did you forget to include spring-cloud-starter-loadbalancer?
Caused by: java.lang.IllegalStateException: No Feign Client for loadBalancing defined. Did you forget to include spring-cloud-starter-loadbalancer?

다른 컴포넌트의 설정 그대로 했는데 의존성 문제가 생겨서 실행도 안됨

 

 

🧸 해결

  • Client 빈 생성할 때 null로 파라미터를 줌
@Configuration
@EnableFeignClients(basePackageClasses = BaseFeignClientPackage.class)
public class FeignCommonConfig {

   @Bean
   public Client FeignCommonConfig() {
        return new Client.Default(null, null);
   }
}
반응형