feign接口IndexOutOfBoundsException索引越界的问题

今天在本地调用feign接口时报出了warning警告:
2019-12-26 10:23:19.126 [schedulerFactoryBean_Worker-8] WARN com.netflix.loadbalancer.BaseLoadBalancer - LoadBalancer [sms-server]: Error choosing server for key null
java.lang.IndexOutOfBoundsException: index (1) must be less than size (1)
at com.google.common.base.Preconditions.checkElementIndex(Preconditions.java:310) ~[guava-18.0.jar:?]
at com.google.common.base.Preconditions.checkElementIndex(Preconditions.java:292) ~[guava-18.0.jar:?]
at com.google.common.collect.SingletonImmutableList.get(SingletonImmutableList.java:45) ~[guava-18.0.jar:?]
at com.netflix.loadbalancer.AbstractServerPredicate.chooseRoundRobinAfterFiltering(AbstractServerPredicate.java:203) ~[ribbon-loadbalancer-2.2.4.jar:2.2.4]
at com.netflix.loadbalancer.PredicateBasedRule.choose(PredicateBasedRule.java:45) ~[ribbon-loadbalancer-2.2.4.jar:2.2.4]
at com.netflix.loadbalancer.BaseLoadBalancer.chooseServer(BaseLoadBalancer.java:736) [ribbon-loadbalancer-2.2.4.jar:2.2.4]
at com.netflix.loadbalancer.ZoneAwareLoadBalancer.chooseServer(ZoneAwareLoadBalancer.java:113) [ribbon-loadbalancer-2.2.4.jar:2.2.4]
at com.netflix.loadbalancer.LoadBalancerContext.getServerFromLoadBalancer(LoadBalancerContext.java:481) [ribbon-loadbalancer-2.2.4.jar:2.2.4]
at com.netflix.loadbalancer.reactive.LoadBalancerCommand1.call(LoadBalancerCommand.java:180) [ribbon-loadbalancer-2.2.4.jar:2.2.4]
at rx.Observable.unsafeSubscribe(Observable.java:10327) [rxjava-1.3.8.jar:1.3.8]
at rx.internal.operators.OnSubscribeConcatMap.call(OnSubscribeConcatMap.java:94) [rxjava-1.3.8.jar:1.3.8]
at rx.internal.operators.OnSubscribeConcatMap.call(OnSubscribeConcatMap.java:42) [rxjava-1.3.8.jar:1.3.8]
at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48) [rxjava-1.3.8.jar:1.3.8]
at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30) [rxjava-1.3.8.jar:1.3.8]
at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48) [rxjava-1.3.8.jar:1.3.8]
at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30) [rxjava-1.3.8.jar:1.3.8]
at rx.Observable.subscribe(Observable.java:10423) [rxjava-1.3.8.jar:1.3.8]
at rx.Observable.subscribe(Observable.java:10390) [rxjava-1.3.8.jar:1.3.8]
at rx.observables.BlockingObservable.blockForSingle(BlockingObservable.java:443) [rxjava-1.3.8.jar:1.3.8]
at rx.observables.BlockingObservable.single(BlockingObservable.java:340) [rxjava-1.3.8.jar:1.3.8]
at com.netflix.client.AbstractLoadBalancerAwareClient.executeWithLoadBalancer(AbstractLoadBalancerAwareClient.java:112) [ribbon-loadbalancer-2.2.4.jar:2.2.4]
at org.springframework.cloud.openfeign.ribbon.LoadBalancerFeignClient.execute(LoadBalancerFeignClient.java:63) [spring-cloud-openfeign-core-2.0.0.M1.jar:2.0.0.M1]
at feign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:97) [feign-core-9.5.1.jar:?]
at feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:76) [feign-core-9.5.1.jar:?]
at feign.ReflectiveFeignProxy151.ecifLifecycle(Unknown Source) [?:?]
at xxx
at org.quartz.core.JobRunShell.run(JobRunShell.java:202) [quartz-2.3.0.jar:?]
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) [quartz-2.3.0.jar:?]
随后还抛出了error信息,调用接口失败.

查询后是因为手动下线了eureka的一个服务,原本两个服务只剩下了一个,所以当调用索引为1的那个服务时,出现了索引越界,因为现在只剩下一个服务了.

你可能感兴趣的:(feign接口IndexOutOfBoundsException索引越界的问题)