Solution:
First, check whether the YML file is configured
spring:
cloud:
nacos:
discovery:
server-addr: 127.0.0.1:8848
application:
name: gulimall-member
If the configuration is completed, check whether the POM file references the configuration center
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
If so, just comment it out.
Problem reason: when Nacos config is used for unified configuration management, the bootstrap.properties configuration file is used to initialize the context when starting the springboot project.
When using the unified configuration of springcloudconfig, the loading order of spring boot configuration files is bootstrap.properties – & gt; bootstrap.yml -> application.properties -> Application.yml, where bootstrap.properties is configured as the highest priority.
Therefore, an error is reported if the properties file is not found during configuration.
If you need to use the Nacos configuration center, on the premise of referencing the above dependencies, you need to add the bootstrap.properties file in the resource directory, configure the service name, Nacos address and port number, and restart the service.
spring.application.name=gulimall-coupon
spring.cloud.nacos.config.server-addr=127.0.0.1:8848
Read More:
- [Solved] nacos Error: com.alibaba.nacos.api.exception.NacosException: failed to req API:/nacos/v1/ns/instance
- Spring cloud remote connect Nacos error [How to Solve]
- [Solved] Nacos offline service error: errCode: 500
- Springcloud builds a gateway and starts Error [Solved]
- [Solved] springCloud Startup Error: Error creating bean with name ‘defaultValidator‘ defined in class path resource
- SpringCloud: Error creating bean with name ‘configurationPropertiesBeans‘
- Springboot startup error: err config is disabled command (Redis Disables Config command)
- [Solved] nacos Startup Error: Unable to start embedded Tomcat
- kakfa Create topic Error: java.util.concurrent.ExecutionException: org.apache.kafka.common.errors.InvalidReplicationFactorException: Replication factor: 3 larger than available brokers: 2.
- [Solved] Springcloud Add Eureka to Startup Error
- Nacos boot error, unable to find Java_HOME [How to Solve]
- Frequent log swiping after Nacos client starts [How to Solve]
- Eclipse relies on spring boot configuration processor, and there is no prompt for writing properties and YML
- [Solved] Nacos1.3.2 Startup Error: Unable to start embedded Tomcat
- SpringBoot Integrating elasticsearch Error: Error creating bean with name ‘restHighLevelClient‘
- Solution to the problem of using Alibaba gateway but unable to route successfully
- Idea create Maven project Error: [error] no longer supports source option 1.5. Please use version 1.6 or higher, and the idea reports an error: error: Java does not support the error of release version 5
- [Solved] nacos Error: Client not connected,current status:STARTING,StatusRuntimeException
- Consumer service instance error: HTTP get http://xxx/actuator/health: 503 output: {“status”: “out_of_service”
- [Solved] nacos Startup Error: Please set the JAVA_HOME variable in your environment