Tag Archives: Development on pit

Integration openfeign failed to start

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.

Centos7 Yum error downloading packages:

Error downloading packages:

gpm-libs-1.20.7-5.el7.x86_64: [Errno 5] [Errno 2] does not have that file or directory

2:vim-common-7.4.160-4. El7.x86_64: [Errno 5] [Errno 2] does not have that file or directory

2:vim-enhanced-7.4.160-4. El7. X86_64: [Errno 5] [Errno 2] does not have that file or directory

2: Vim-Filesystem 7.4.160-4.el7.x86_64: [Errno 5] [Errno 2] does not have that file or directory
In python3.5, I found that GCC-C ++ was not installed, and then yum installed it. I updated the source of Yum,yum Clean all, and Yum Make Cache, but it didn’t work. Suddenly I remembered that I had deleted the Python under /usr/bin, and I remember the python soft connection pointing to Python 2

Change Python 2 to Python so yum can use it

In the /usr/bin/yum file, the header file refers to this thing

The previous idea was to change the header file to python2, which came up later

When Linux enters a command on the command line, if there is a $character, the TAB key will automatically be preceded by an escape character, which will not achieve the desired effect. To solve this problem, you need to set up, do not let it escape automatically, execute the command (command means open directory extension,-s is open): shopt-s direxpand then support the command just now, press TAB will turn $JAVA_HOME into a real folder, then TAB prompt is very convenient, achieve the ideal effect
CD $JAVA_HOME/ Then press TAB