You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Spring Cloud Config官方示例启动报错:NoClassDefFoundError求助

Troubleshooting java.lang.NoClassDefFoundError for AbstractHealthIndicator in Spring Cloud Config Server

Hey there, let's dig into this NoClassDefFoundError issue you're facing with your Spring Cloud Config Server. The error boils down to the JVM being unable to locate the org.springframework.boot.actuate.health.AbstractHealthIndicator class, and there are a few common fixes we can try:

1. Fix Spring Cloud & Spring Boot Version Compatibility

Spring Cloud and Spring Boot have strict version binding rules—using mismatched versions often leads to missing dependency classes. You're running Spring Boot 1.5.9.RELEASE, which pairs with Spring Cloud Edgware.SR3 (the officially recommended compatible version).

Check your pom.xml's dependency management section to ensure the correct Spring Cloud version is set:

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-dependencies</artifactId>
            <version>Edgware.SR3</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

If the version was incorrect, update it and run mvn clean install to refresh your dependencies.

2. Explicitly Add the Spring Boot Actuator Dependency

While the official guide might not list it explicitly, some internal components of Spring Cloud Config Server rely on Actuator's health indicator classes. Adding this dependency will pull in the missing AbstractHealthIndicator class:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

3. Clean and Refresh Your Maven Dependencies

Occasionally, local Maven repository files can become corrupted or incomplete. Run these commands to clean up and re-download fresh copies of your dependencies:

mvn clean
mvn install -U

The -U flag forces Maven to update snapshot dependencies, ensuring you get the latest and complete versions.

After trying these steps, restart your Config Server—it should start up without the NoClassDefFoundError now.

内容的提问来源于stack exchange,提问作者Alessandro Argentieri

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 08:36:18