Tag Archives: spring cloud

OpenFeignClient Use Object to Receive text/plain Type Return Error

report errors

Could not extract response: no suitable HttpMessageConverter found for
response type [classxxxx] and content type [text/plain]

reason

The return type content type is not application/JSON, but text/plain. It cannot be deserialized into object type, as shown in the figure

spring cloud openfeign essentially uses okhttpclient for request. If it is text/plain, it will be treated as text and cannot be deserialized automatically like JSON string, The following is my feinclient:

in this case, it is necessary to do compatibility processing for the return of this content type
add the jackson2httpmessageconverter conversion class, and increase the compatibility of text/plain and text/HTML return types

import org.springframework.http.MediaType;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;

import java.util.ArrayList;
import java.util.List;

/**
 * @author <a href="mailto:[email protected]">Tino.Tang</a>
 * @version ${project.version} - 2021/12/9
 */
public class MyJackson2HttpMessageConverter extends MappingJackson2HttpMessageConverter {

  public LokiJackson2HttpMessageConverter() {
    List<MediaType> mediaTypes = new ArrayList<>();
    mediaTypes.add(MediaType.TEXT_PLAIN);
    mediaTypes.add(MediaType.TEXT_HTML);
    setSupportedMediaTypes(mediaTypes);
  }
}

Add openfeign custom configuration and inject Decoder Bean.

import feign.Logger;
import feign.codec.Decoder;
import org.springframework.beans.factory.ObjectFactory;
import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
import org.springframework.cloud.openfeign.support.SpringDecoder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author <a href="mailto:[email protected]">Tino.Tang</a>
 * @version ${project.version} - 2021/11/29
 */
@Configuration
public class OpenFeignLogConfig {

  @Bean
  public Logger.Level feignLoggerLeave() {
    return Logger.Level.FULL;
  }

  @Bean
  public Decoder feignDecoder() {
    LokiJackson2HttpMessageConverter converter = new LokiJackson2HttpMessageConverter();
    ObjectFactory<HttpMessageConverters> objectFactory = () -> new HttpMessageConverters(converter);
    return new SpringDecoder(objectFactory);
  }
}```

After processing, the call to the feign client will no longer report errors, regardless of whether the type is application/json or text/plain, it can be correctly deserialized to Object.

How to Solve nacos Startup Error and Connect to MYSQL

Error reason for Nacos startup: the default configuration of Nacos is cluster startup, which can be modified to stand-alone startup (after Nacos 1.3.2, the default mode of Nacos is cluster mode).

The Nacos directory structure is as follows (the version of Nacos I use is 2.0.3):

1.open the bin directory and modify startup.com script

2.connects to MySQL, executes the SQL statement

opens the conf folder, creates a Nacos database, executes the following script

after execution, the results are as follows

3.opens the conf folder, modifies the configuration information

finds the following configuration in the conf folder and modifies the marked configuration items

test access 127.0 0.1:8848/Nacos account/password: Nacos/Nacos successfully opened the following page

Spring cloud remote connect Nacos error [How to Solve]


Problem description

Spring cloud Alibaba micro service architecture is used, and Nacos is used in the service discovery and configuration center

At the beginning, Nacos was started locally, and everything was normal,

After Nacos is migrated to the cloud, change the Nacos address in the configuration file

The gateway service reports an error java.net.connectexception: no available server, because it is always connected to localhost:8848 .

The console outputs the following screenshot:

Cause location

Because the parent POM dependency is imported:

spring-cloud-starter-Alibaba-Nacos-config and spring-cloud-starter-Alibaba-Nacos-discovery

In local development, items such as testing, registration and discovery are configured in application.yml, the central configuration file bootstrap.properties is not created

Springboot automation configuration defaults to localhost:8848 , so there is no problem with the local environment.

Solution:

Remove useless dependencies (if nacos-config is not used, remove spring-cloud-starter-alibaba-nacos-config dependencies)

[Solved] Spring cloud introduces zuul dependency error

When creating the zuul project, I found that spring cloud routing does not have zuul

and then directly click next. I think it is possible to introduce zuul dependency by directly writing dependency code in POM file
then I added the following dependencies to the POM file:

   <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-zuul</artifactId>
            <version>2.2.10.RELEASE</version>
        </dependency>

Then add @enablezuulproxy
to the startup class. Click Startup and find that an error is reported
Solution:
①: configure version and add & lt; spring-cloud.version>

    <properties>
        <java.version>1.8</java.version>
        <spring-cloud.version>2021.0.0-RC1</spring-cloud.version>
    </properties>

②: add unified version configuration

  <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>${spring-cloud.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

③: add warehouse configuration

    <repositories>
        <repository>
            <id>spring-milestones</id>
            <name>Spring Milestones</name>
            <url>https://repo.spring.io/milestone</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>

Method ①, ② and ③ seem to be indispensable, otherwise it will not start.

(in fact, the spring boot version conflicts with the spring cloud version)
we can click the zuul dependency package to see that it contains the starter of spring boot
therefore, we can directly cancel the parent tag so that it does not introduce parent dependency

however, I don’t think it’s good to cancel the parent dependency directly. After all, there are few introductions, and there is no need to consider the conflict of versions. Therefore, in order not to remove the parent tag, we can introduce the version dependency that does not conflict between spring boot and spring cloud.

Attach the complete POM configuration:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.6.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>cn.itcast.zuul</groupId>
    <artifactId>itcast-zuul</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>itcast-zuul</name>
    <description>Demo project for Spring Boot</description>
    <properties>
        <java.version>1.8</java.version>
    </properties>
    <dependencies>


        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-zuul</artifactId>
            <version>2.0.2.RELEASE</version>
        </dependency>
    </dependencies>

</project>


[Solved] renren-fast Startup Error: Error creating bean with name ‘scheduleJobController‘

When doing the gulimall mall project, start Ren fast to report an error in the background. The error information is as follows:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'scheduleJobController': Unsatisfied dependency expressed through field 'scheduleJobService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scheduleJobService': Invocation of init method failed; nested exception is io.renren.common.exception.RRException: 获取定时任务CronTrigger出现异常
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:643)
	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:116)
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1422)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)

Cause analysis: beans cannot be created or loaded. The problem is generally in configuration

Solution steps:
1. Check dao tier, service tier, controller tier is annotated or not?

2. When the annotation of Dao tier, service tier and controller tier is complete, check whether the corresponding package is added to the package scanning for these annotations. If not, add it (generally check in the spring configuration file)

3. Check the corresponding YML and properties files, or check whether the database SQL is executed normally

The solution to this problem: delete the contents of the current database and re-execute the SQL file

[Solved] nacos Startup Error: Error creating bean with name ‘authFilterRegistration‘ defined in class path resource

Today, an error was suddenly reported when Nacos was started. The error information on the Nacos startup interface is as follows:

 Error creating bean with name 'authFilterRegistration' defined in class path resource
 [com/alibaba/nacos/core/auth/AuthConfig.class]: 
 Bean instantiation via factory method failed; 
 nested exception is org.springframework.beans.BeanInstantiationException:
 Failed to instantiate [org.springframework.boot.web.servlet.FilterRegistrationBean]:
 Factory method 'authFilterRegistration' threw exception;
 nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException:
 Error creating bean with name 'authFilter':
 Unsatisfied dependency expressed through field 'authManager';
 nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: 
 Error creating bean with name 'nacosAuthManager':
 Unsatisfied dependency expressed through field 'authenticationManager';
 nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException:
 Error creating bean with name 'nacosAuthConfig': 
 Unsatisfied dependency expressed through field 'userDetailsService';
 nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException:
 Error creating bean with name 'nacosUserDetailsServiceImpl':
 Unsatisfied dependency expressed through field 'userPersistService'; 
 nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException:
 Error creating bean with name 'externalUserPersistServiceImpl': 
 Unsatisfied dependency expressed through field 'persistService'; 
 nested exception is org.springframework.beans.factory.BeanCreationException: 
 Error creating bean with name 'externalStoragePersistServiceImpl': 
 Invocation of init method failed; nested exception is java.lang.RuntimeException:
 java.lang.RuntimeException: [db-load-error]load jdbc.properties error

Idea spooling error message:

[NACOS SocketTimeoutException httpGet] currentServerAddr:http://localhost:8848, err : connect timed out

Cause analysis: the project may not load Nacos related files correctly

Solution: delete the existing Nacos folder, decompress or download the Nacos compressed package again, and start startup.cmd. The problem is solved

If an error is reported, it may be that set mode = “” in the startup.cmd file is inappropriate

set BASE_DIR="%BASE_DIR:~0,-5%"

set CUSTOM_SEARCH_LOCATIONS=file:%BASE_DIR%/conf/

set MODE="cluster"
set FUNCTION_MODE="all"
set SERVER=nacos-server
set MODE_INDEX=-1
set FUNCTION_MODE_INDEX=-1
set SERVER_INDEX=-1
set EMBEDDED_STORAGE_INDEX=-1
set EMBEDDED_STORAGE=""

Solution: change set mode = "cluster" to set mode = "standalone".

Feign call Error: duplicate name [How to Solve]

 

Description:
The bean ‘personnel.FeignClientSpecification’, defined in null, could not be registered. A bean with that name has already been defined in null and overriding is disabled.
Action:
Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true

Solution 1:
Applicati.yml configuration file is added to allow duplicate names

Solution 2:
Write together the contents of different feign interfaces called by the same microservice


Write the contents of the two interfaces together

Eureka server startup error: cannot execute request on any known server

Article catalog

Error reporting screenshot reference: self inspection modification

Error reporting screenshot reference:

Self inspection

As soon as a new Eureka project was established, an error was reported. After checking the startup class and YML configuration file, it was found that the format of YML configuration file was wrong. The error is as follows:

Modification

There is an obvious indentation error in the screenshot, which makes Eureka unable to start normally. After modifying the indentation, it is as follows:

Screenshot of successful startup of Eureka server:

If the configuration file in YML format is prone to errors, we recommend that you use the configuration file in properties format; As follows:

[Solved] Springcloud config Error: Error occured cloning to base directory.

An error occurred when springcloud config obtained the remote configuration file
error source code: 2021-11-03 19:51:31.421 warn 6608 – [on (3) – 127.0.0.1]. C.s.e.multiplejgitenvironmentrepository: error occurred cloning to base directory

org.eclipse.jgit.api.errors.TransportException: https://github.com/ClowLAY/spring-cloud-config.git: Cannot open git upload pack

error reason: the project cannot be cloned because the remote GitHub warehouse cannot be connected
solution: modify the configuration file application.properties

#previous code
spring.cloud.config.server.git.uri=https://github.com/ClowLAY/spring-cloud-config.git

#Modified Code
[email protected]:ClowLAY/spring-cloud-config.git

Successfully obtained the remote warehouse configuration file

Note: change the proxy mode from HTTPS to git
remember to change the remote warehouse address to your own remote warehouse address

gateway Internal Server Error 500 Invalid host: lb://xxxxxx

The following error occurred while accessing other project interfaces through the gateway

2021-11-01 17:01:28.244 ERROR 4732 --- [ctor-http-nio-2] a.w.r.e.AbstractErrorWebExceptionHandler : [5761064e-3]  500 Server Error for HTTP GET "/admin/user/list"

java.lang.IllegalStateException: Invalid host: lb://zkdn_admin
	at org.springframework.cloud.gateway.filter.RouteToRequestUrlFilter.filter(RouteToRequestUrlFilter.java:86) ~[spring-cloud-gateway-server-2.2.6.RELEASE.jar:2.2.6.RELEASE]
	Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException: 
Error has been observed at the following site(s):
	|_ checkpoint ⇢ org.springframework.cloud.gateway.filter.WeightCalculatorWebFilter [DefaultWebFilterChain]
	|_ checkpoint ⇢ HTTP GET "/admin/user/list" [ExceptionHandlingWebHandler]
Stack trace:
		at org.springframework.cloud.gateway.filter.RouteToRequestUrlFilter.filter(RouteToRequestUrlFilter.java:86) ~[spring-cloud-gateway-server-2.2.6.RELEASE.jar:2.2.6.RELEASE]

The reason is that the service name registered in Nacos has “”, which can be solved by changing the underscore to “-“.

When the springcloud obtains the cloud link database information, an error is reported: errorcode 1045, state 28000

Today, when doing the micro service exercise, put the relevant information of the linked database on the code cloud warehouse, and configure application.yml through config to pull the data; An error occurs when querying the user’s Micro service connection database

Post error message first

jdbc:mysql://localhost:3306/springboot?serverTimezone=GMT%2B8, errorCode 1045, state 28000

java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:835) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:455) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:240) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:199) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1657) ~[druid-1.2.7.jar:1.2.7]
	at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1723) ~[druid-1.2.7.jar:1.2.7]
	at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2838) ~[druid-1.2.7.jar:1.2.7]

2021-11-03 18:43:32.882 ERROR 14288 --- [eate-2036393189] com.alibaba.druid.pool.DruidDataSource   : create connection SQLException, url: jdbc:mysql://localhost:3306/springboot?serverTimezone=GMT%2B8, errorCode 1045, state 28000

java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:835) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:455) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:240) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:199) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1657) ~[druid-1.2.7.jar:1.2.7]
	at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1723) ~[druid-1.2.7.jar:1.2.7]
	at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2838) ~[druid-1.2.7.jar:1.2.7]

2021-11-03 18:43:32.883  INFO 14288 --- [eate-2036393189] c.a.druid.pool.DruidAbstractDataSource   : {dataSource-1} failContinuous is true
2021-11-03 18:43:33.397 ERROR 14288 --- [eate-2036393189] com.alibaba.druid.pool.DruidDataSource   : create connection SQLException, url: jdbc:mysql://localhost:3306/springboot?serverTimezone=GMT%2B8, errorCode 1045, state 28000

java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:835) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:455) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:240) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:199) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1657) ~[druid-1.2.7.jar:1.2.7]
	at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1723) ~[druid-1.2.7.jar:1.2.7]
	at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2838) ~[druid-1.2.7.jar:1.2.7]

2021-11-03 18:43:33.908 ERROR 14288 --- [eate-2036393189] com.alibaba.druid.pool.DruidDataSource   : create connection SQLException, url: jdbc:mysql://localhost:3306/springboot?serverTimezone=GMT%2B8, errorCode 1045, state 28000

java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:835) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:455) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:240) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:199) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1657) ~[druid-1.2.7.jar:1.2.7]
	at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1723) ~[druid-1.2.7.jar:1.2.7]
	at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2838) ~[druid-1.2.7.jar:1.2.7]

2021-11-03 18:43:34.420 ERROR 14288 --- [eate-2036393189] com.alibaba.druid.pool.DruidDataSource   : create connection SQLException, url: jdbc:mysql://localhost:3306/springboot?serverTimezone=GMT%2B8, errorCode 1045, state 28000

Config:

server:
  port: 9100
spring:
  application:
    name: config-server
  cloud:
    config:
      server:
        git:
          uri: https://gitee.com/shangdigao/shop1103
          username: [email protected]
          password: GYH000909
eureka:
  client:
    service-url:
      defaultZone: http://localhost:8761/eureka

Member (user micro service)

eureka:
  client:
    service-url:
      defaultZone: http://localhost:8761/eureka
spring:
  application:
    name: member-server
  cloud:
    config:
      discovery:
        enabled: true
        service-id: config-server
      label: master
      name: member-server

Code cloud:

According to the error report, it is found that there is a problem with the user name and password when connecting to the database. After many attempts, it is found that the password pulled by config from the code cloud is incorrect

It is possible that the 0 at the beginning of the password was not obtained

Change the database login password to 123456

Run successfully

 

Using openfeign to remotely call the startup program to report an error

Add openfeign directly to POM

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-openfeign</artifactId>
        </dependency>

Program startup report found

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

Because the spring boot and spring cloud versions are higher, the loadbalancer dependency needs to be added

The problem is that there is no loadalanc, but note that the ribbon in Nacos will cause the loadalanc package to fail. Add it in the common POM

<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>
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-loadbalancer</artifactId>
    <version>3.0.3</version>
</dependency>