Closed myifeng closed 2 years ago
could you provide your application's pom.xml?
This is a dependency related to SpringCloud, nacos, and alibaba, omitting other business dependencies.
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.3</version>
<relativePath/>
</parent>
<properties>
<alibaba-dependencies.version>2.2.7.RELEASE</alibaba-dependencies.version>
<java.version>1.8</java.version>
<spring-cloud.version>2021.0.0</spring-cloud.version>
<spring-cloud-bootstrap.version>3.1.0</spring-cloud-bootstrap.version>
<nacos.version>2.2.7.RELEASE</nacos.version>
</properties>
<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>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bootstrap</artifactId>
<version>${spring-cloud-bootstrap.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
<version>${alibaba-dependencies.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
<version>${nacos.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
<version>${nacos.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-client</artifactId>
<version>2.0.4</version>
</dependency>
</dependencies>
</dependencyManagement>
Oh, My bad. I'm using the wrong nacos that I built myself ,after removing it it worked.
May I ask how you modified it? I use the same version and still have this error
<!-- 引入nacos-client:1.4.8解决问题-->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
<exclusions>
<exclusion>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-client</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-client</artifactId>
<version>1.4.8</version>
</dependency>
Describe the bug
java.lang.ClassNotFoundException: com.alibaba.nacos.common.utils.StringUtils
error occurs when usingnacos 2.0.4
andspring-cloud-starter-alibaba-nacos-config 2.2.7.RELEASE
Expected behavior A clear and concise description of what you expected to happen.
Acutally behavior A clear and concise description of what you actually to happen.
How to Reproduce Steps to reproduce the behavior:
Desktop (please complete the following information):
Additional context Add any other context about the problem here.