原因一:nacos没有正确启动
nacos双击启动时默认是以集群的方式启动,所以会报错,在cmd下用命令启动
startup.cmd -m standalone
原因二:没有导入web依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
原因三:SpringCloud、SpringCloudAlibaba版本不对应
<!-- spring boot的版本号 -->
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.9.RELEASE</version>
<relativePath/>
</parent>
<!-- 版本控制 -->
<properties>
<java.version>1.8</java.version>
<spring-cloud.version>Hoxton.SR10</spring-cloud.version>
<spring-cloud-alibaba.version>2.2.5.RELEASE</spring-cloud-alibaba.version>
</properties>
<!-- 依赖模板 -->
<dependencyManagement>
<dependencies>
<!-- spring cloud的版本依赖 -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- spring cloud alibaba 的版本依赖 主要是用了nacos -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
<version>${spring-cloud-alibaba.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
标签:--,spring,boot,Nacos,springframework,alibaba,ERROR,org,cloud
From: https://www.cnblogs.com/cxy-lxl/p/16739908.html