Using the open feign development interface, the direct startup fails, and the following exception is thrown:
nested exception is java.lang.IllegalStateException: No Feign Client for loadBalancing defined. Did you forget to include spring-cloud-starter-loadbalancer?
The problem is obviously that spring cloud starter loadbalancer
is not added, so in the pom.xml Add the following dependencies to:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-loadbalancer</artifactId>
</dependency>
After re importing the dependency, it starts successfully, but the calling interface still reports an error:
java.lang.AbstractMethodError: org.springframework.cloud.netflix.ribbon.RibbonLoadBalancerClient.choose(Ljava/lang/String;Lorg/springframework/cloud/client/loadbalancer/Request;)Lorg/springframework/cloud/client/ServiceInstance;
This is because spring cloud replaces the load balancing component from ribbon to loadbalancer. You need to exclude the ribbon component in spring cloud starter Alibaba Nacos discovery, otherwise loadbalancer will not work.
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-ribbon</artifactId>
</exclusion>
</exclusions>
</dependency>
After re importing the dependency, restart the project and call successfully.
Read More:
- Using openfeign to remotely call the startup program to report an error
- Solution to CUDA installation failure problem visual studio integration failed
- Error: (serious: a child container failed during start) (server component failed to start so Tomcat is unable)
- Ubuntu failed to start sshd with an error: failed to start OpenBSD secure shell server
- CUDA Visual Studio Integration Installation failed
- Notes on @ pathvariable annotation in springcloud openfeign
- Mybatis idea environment integration jar package
- Tdengine failed to start, start request repeated too quickly for taosd.service
- MySQL failed to start prompt: job failed to start
- Zookeeper Failed to Start Error: start failed [How to Solve]
- ‘dependencies.dependency.version‘ for org.springframework.cloud:spring-cloud-starter-openfeign:jar
- Net start mongodb failed to start: system error 5 has occurred. Access is denied
- Docker start error: failed to start docker application container engine.
- [Solved] Tomcat Failed to Start Error: Server Tomcat v8.5 Server at localhost failed to start
- MySQL uses net start MySQL startup prompt (failed to start, the service did not report any error)
- The seahorse play simulator failed to start, start machine failed! error code = 3 and error code = 21
- VirtualBox failed to start, prompt failed to open a session for the virtual machine windoze 7
- Building Eureka_ Server error: application failed to start with classpath:file :/C:/ProgramFiles/Java/jdk
- Error running app:Instant Run requires Tools | Android Enable ADB integration‘ to be enabled.
- One or more filters failed to start