title: Eureka Ribbon Client not working after upgrading to spring-cloud-starter-netflix-eureka-client:jar:2.2.7.RELEASE
body: <p>So, we upgraded spring-cloud-netflix libraries from <code>2.2.2.RELEASE</code> to <code>2.2.7.RELEASE</code>. I was not expecting major hiccups but upon testing I kept seeing this error.</p>
  <pre><code>Caused by: com.netflix.client.ClientException: Load balancer does not have available server for client: dummy-service
  at com.netflix.loadbalancer.LoadBalancerContext.getServerFromLoadBalancer(LoadBalancerContext.java:483) ~[ribbon-loadbalancer-2.3.0.jar:2.3.0]
  at com.netflix.loadbalancer.reactive.LoadBalancerCommand$1.call(LoadBalancerCommand.java:184) ~[ribbon-loadbalancer-2.3.0.jar:2.3.0]
  at com.netflix.loadbalancer.reactive.LoadBalancerCommand$1.call(LoadBalancerCommand.java:180) ~[ribbon-loadbalancer-2.3.0.jar:2.3.0]
  </code></pre>
  <p>We are also using Netflix Zuul with spring <code>spring-cloud-starter-netflix-zuul:2.2.7.RELEASE</code>.</p>
  <p>Upon further debugging, I found that implementation of the <code>ServerList</code> property in <code>DynamicServerListLoadBalancer</code> is actually <code>ConfigurationBasedServerList</code> and not <code>DomainExtractingServerList</code> (which is supposed to wrap <code>DiscoveryEnabledNIWSServerList</code>). This observation also contradicts with the expected behavior in the spring-cloud docs <a href="https://cloud.spring.io/spring-cloud-netflix/multi/multi_spring-cloud-ribbon.html#_using_ribbon_with_eureka" rel="nofollow noreferrer">here</a></p>
  <blockquote>
  <p>When Eureka is used in conjunction with Ribbon (that is, both are on the classpath), the ribbonServerList is overridden with an extension of DiscoveryEnabledNIWSServerList, which populates the list of servers from Eureka. It also replaces the IPing interface with NIWSDiscoveryPing, which delegates to Eureka to determine if a server is up. The ServerList that is installed by default is a DomainExtractingServerList.</p>
  </blockquote>
  <p>I also noticed that my <code>spring-cloud-starter-netflix-eureka-client:jar:2.2.7.RELEASE</code> is downloading <code>spring-cloud-netflix-eureka-client:jar:3.0.2</code> transitively which does not have <code>EurekaRibbonClientConfiguration</code> and <code>DomainExtractingServerList</code>. <strong>Is that intentional?</strong></p>
  <pre class="lang-sh prettyprint-override"><code> +- org.springframework.cloud:spring-cloud-starter-netflix-eureka-client:jar:2.2.7.RELEASE:compile
  [INFO] |  +- org.springframework.cloud:spring-cloud-netflix-hystrix:jar:2.2.7.RELEASE:compile
  [INFO] |  +- org.springframework.cloud:spring-cloud-netflix-eureka-client:jar:3.0.2:compile
  </code></pre>
  <p>I was expecting 2.x to work with 3.x since the library is being pulled transitively but that is not happening here.
  BTW, I also tried to add <code>spring-cloud-netflix-eureka-client:jar:2.2.7.RELEASE</code> inline in my pom file to override 3.0.2 but then ran into some class definition not found errors.</p>
  <p>What is the suggestion in this case? Should I create a <code>EurekaRibbonClientConfiguration</code> inside my application so that I can get the correct <code>ServerList</code> injected? <code>EurekaRibbonClientConfiguration</code> seems to be doing much more than create a <code>ServerList</code> bean implementation.
  I cannot use <code>3.0.2</code> because I am also using Zuul and Spring-cloud-zuul is maxed out at <a href="https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-netflix-zuul/2.2.7.RELEASE" rel="nofollow noreferrer">2.2.7.RELEASE</a>.</p>
  <p>I really need to keep using Spring-cloud, Zuul, Ribbon and Eureka.</p>
  <p><strong>Update</strong> Here is my pom file:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot;
           xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
           xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;com.cdm&lt;/groupId&gt;
      &lt;artifactId&gt;api-internal-gateway&lt;/artifactId&gt;
      &lt;version&gt;${default.version}&lt;/version&gt;
  
      &lt;parent&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
          &lt;version&gt;2.4.4&lt;/version&gt;
          &lt;relativePath/&gt; &lt;!-- lookup parent from repository --&gt;
      &lt;/parent&gt;
  
      &lt;properties&gt;
          &lt;default.version&gt;DEV-SNAPSHOT&lt;/default.version&gt;
          &lt;java.version&gt;11&lt;/java.version&gt;     
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;project.reporting.outputEncoding&gt;UTF-8&lt;/project.reporting.outputEncoding&gt;
          &lt;spring-cloud.version&gt;2020.0.2&lt;/spring-cloud.version&gt;
          &lt;springfox.version&gt;2.9.2&lt;/springfox.version&gt;
          &lt;spring-cloud.extras.version&gt;2.2.7.RELEASE&lt;/spring-cloud.extras.version&gt;
      &lt;/properties&gt;
  
    
      &lt;dependencyManagement&gt;
          &lt;dependencies&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-cloud-dependencies&lt;/artifactId&gt;
                  &lt;version&gt;${spring-cloud.version}&lt;/version&gt;
                  &lt;type&gt;pom&lt;/type&gt;
                  &lt;scope&gt;import&lt;/scope&gt;
              &lt;/dependency&gt;
          &lt;/dependencies&gt;
      &lt;/dependencyManagement&gt;
      
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.projectlombok&lt;/groupId&gt;
              &lt;artifactId&gt;lombok&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-actuator&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
              &lt;artifactId&gt;spring-cloud-starter-sleuth&lt;/artifactId&gt;
              &lt;version&gt;${spring-cloud.extras.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
              &lt;artifactId&gt;spring-cloud-starter-netflix-eureka-client&lt;/artifactId&gt;
              &lt;version&gt;${spring-cloud.extras.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
              &lt;artifactId&gt;spring-cloud-starter-netflix-zuul&lt;/artifactId&gt;
              &lt;version&gt;${spring-cloud.extras.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.mockito&lt;/groupId&gt;
              &lt;artifactId&gt;mockito-core&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.junit.jupiter&lt;/groupId&gt;
              &lt;artifactId&gt;junit-jupiter&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.mockito&lt;/groupId&gt;
              &lt;artifactId&gt;mockito-all&lt;/artifactId&gt;
              &lt;version&gt;2.0.2-beta&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          
          &lt;!-- API --&gt;
          &lt;dependency&gt;
            &lt;groupId&gt;jakarta.xml.ws&lt;/groupId&gt;
            &lt;artifactId&gt;jakarta.xml.ws-api&lt;/artifactId&gt;
            &lt;version&gt;2.3.2&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- Runtime --&gt;
          &lt;dependency&gt;
            &lt;groupId&gt;com.sun.xml.ws&lt;/groupId&gt;
            &lt;artifactId&gt;jaxws-rt&lt;/artifactId&gt;
            &lt;version&gt;2.3.2&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- https://mvnrepository.com/artifact/javax.xml.bind/jaxb-api --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.xml.bind&lt;/groupId&gt;
              &lt;artifactId&gt;jaxb-api&lt;/artifactId&gt;
              &lt;version&gt;2.3.1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.annotation&lt;/groupId&gt;
              &lt;artifactId&gt;javax.annotation-api&lt;/artifactId&gt;
              &lt;version&gt;1.3.1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.google.code.findbugs&lt;/groupId&gt;
              &lt;artifactId&gt;jsr305&lt;/artifactId&gt;
              &lt;version&gt;3.0.2&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.transaction&lt;/groupId&gt;
              &lt;artifactId&gt;javax.transaction-api&lt;/artifactId&gt;
              &lt;version&gt;1.2&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
  &lt;/project&gt;
  </code></pre>