1

After upgrading to 2.5.12 from 2.3 I am getting the following exception:

java.lang.IllegalArgumentException: Could not find class [org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration]

I tried including the dependency manually also:

<dependency>
  <groupid>org.springframework.boot</groupid>
  <artifactid>spring-boot-starter-actuator</artifactid>
</dependency>

but still this issue exists, below are the versions I use:

Java 11 spring cloud : 2020.0.4 io.pivotal.spring.cloud: 3.4.0 wavefront : 2.2.1 spring-sleuth: 3.0.4

can anybody pls help?

Log:

2022-04-12 23:00:49.370 ERROR [traceId-,spanId-] [main] o.s.boot.SpringApplication : Application run failed
2022-04-13T11:30:54.31+0530 [APP/PROC/WEB/0] OUT java.lang.IllegalArgumentException: Could not find class [org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration]
2022-04-13T11:30:54.41+0530 [APP/PROC/WEB/0] OUT    at org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:334)
2022-04-13T11:30:54.51+0530 [APP/PROC/WEB/0] OUT    at org.springframework.core.annotation.TypeMappedAnnotation.adapt(TypeMappedAnnotation.java:446)
2022-04-13T11:30:54.61+0530 [APP/PROC/WEB/0] OUT    at org.springframework.core.annotation.TypeMappedAnnotation.getValue(TypeMappedAnnotation.java:369)
2022-04-13T11:30:54.71+0530 [APP/PROC/WEB/0] OUT    at org.springframework.core.annotation.TypeMappedAnnotation.asMap(TypeMappedAnnotation.java:284)
2022-04-13T11:30:54.81+0530 [APP/PROC/WEB/0] OUT    at org.springframework.core.annotation.AbstractMergedAnnotation.asAnnotationAttributes(AbstractMergedAnnotation.java:193)
2022-04-13T11:30:54.91+0530 [APP/PROC/WEB/0] OUT    at org.springframework.core.type.AnnotatedTypeMetadata.getAnnotationAttributes(AnnotatedTypeMetadata.java:106)
2022-04-13T11:30:55.01+0530 [APP/PROC/WEB/0] OUT    at org.springframework.core.type.AnnotatedTypeMetadata.getAnnotationAttributes(AnnotatedTypeMetadata.java:81)
2022-04-13T11:30:55.11+0530 [APP/PROC/WEB/0] OUT app instance exceeded log rate limit (10 log-lines/sec) set by platform operator
2022-04-13T11:30:55.11+0530 [APP/PROC/WEB/0] OUT    at org.springframework.context.annotation.AnnotationConfigUtils.attributesFor(AnnotationConfigUtils.java:285)
2022-04-13T11:30:55.21+0530 [APP/PROC/WEB/0] OUT    at org.springframework.context.annotation.AnnotationBeanNameGenerator.determineBeanNameFromAnnotation(AnnotationBeanNameGenerator.java:103)
2022-04-13T11:30:55.31+0530 [APP/PROC/WEB/0] OUT    at org.springframework.context.annotation.AnnotationBeanNameGenerator.generateBeanName(AnnotationBeanNameGenerator.java:82)
2022-04-13T11:30:55.41+0530 [APP/PROC/WEB/0] OUT    at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.registerBeanDefinitionForImportedConfigurationClass(ConfigurationClassBeanDefinitionReader.java:169)
2022-04-13T11:30:55.51+0530 [APP/PROC/WEB/0] OUT    at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:150)

Guys this is my pom dependencies:


<dependencies>
    
    <dependency>
            <groupId>com.wavefront</groupId>
            <artifactId>wavefront-spring-boot-starter</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>com.fasterxml.jackson.core</groupId>
                    <artifactId>jackson-annotations</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.fasterxml.jackson.core</groupId>
                    <artifactId>jackson-databind</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.fasterxml.jackson.core</groupId>
                    <artifactId>jackson-core</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-autoconfigure</artifactId>
                </exclusion>
            </exclusions>
    </dependency>
    
    <dependency>
                    <groupId>com.fasterxml.jackson.core</groupId>
                    <artifactId>jackson-databind</artifactId>
                </dependency>
    
  <dependency>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>
                        spring-boot-starter-actuator
                    </artifactId>
                    <exclusions>
                        <exclusion>
                            <groupId>
                                com.fasterxml.jackson.core
                            </groupId>
                            <artifactId>jackson-annotations</artifactId>
                        </exclusion>
                        <exclusion>
                            <groupId>org.springframework.boot</groupId>
                            <artifactId>spring-boot-starter</artifactId>
                        </exclusion>
                        <exclusion>
                            <groupId>
                                com.fasterxml.jackson.core
                            </groupId>
                            <artifactId>jackson-databind</artifactId>
                        </exclusion>
                        <exclusion>
                            <groupId>
                                com.fasterxml.jackson.core
                            </groupId>
                            <artifactId>jackson-core</artifactId>
                        </exclusion>
                        <exclusion>
                            <groupId>org.springframework.boot</groupId>
                            <artifactId>
                                spring-boot-autoconfigure
                            </artifactId>
                        </exclusion>
                    </exclusions>
  </dependency>
                
        
        <dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-bootstrap</artifactId>
    <exclusions>
        <exclusion>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
        </exclusion>
    </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>com.fasterxml.jackson.core</groupId>
                    <artifactId>jackson-annotations</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.fasterxml.jackson.core</groupId>
                    <artifactId>jackson-databind</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.fasterxml.jackson.core</groupId>
                    <artifactId>jackson-core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-aop</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
<dependency>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-aop</artifactId>
                </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter</artifactId>
                </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-autoconfigure</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- Spring Cloud Dependencies -->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-config</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-autoconfigure</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.fasterxml.jackson.core</groupId>
                    <artifactId>jackson-annotations</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.fasterxml.jackson.core</groupId>
                    <artifactId>jackson-databind</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.fasterxml.jackson.core</groupId>
                    <artifactId>jackson-core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-vault-config</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>com.fasterxml.jackson.core</groupId>
                    <artifactId>jackson-databind</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-cache</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>com.github.ben-manes.caffeine</groupId>
            <artifactId>caffeine</artifactId>
        </dependency>

        <!-- Zipkin Dependencies -->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-sleuth-zipkin</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-stream-kafka</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-autoconfigure</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.fasterxml.jackson.core</groupId>
                    <artifactId>jackson-databind</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-dbcp2</artifactId>
        </dependency>

        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.retry</groupId>
            <artifactId>spring-retry</artifactId>
        </dependency>


        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
        </dependency>

        <dependency>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-web</artifactId>
                </dependency>
        
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-configuration-processor</artifactId>
            <optional>true</optional>
        </dependency>
    </dependencies>
    <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>com.wavefront</groupId>
        <artifactId>wavefront-spring-boot-bom</artifactId>
        <version>${wavefront.version}</version>
        <type>pom</type>
        <scope>import</scope>
  </dependency>
    </dependencies>
</dependencyManagement>

I have tried almost all ways excluding every conflicting dependency,adding everything manually, adding the jar as an external dependency, even cloud dependency is correctly configured.Can anybody please help me why still this is not loading that actuate.autoconfigure.health.HealthIndicatorAutoConfiguration class? I am seriously vexed with this and not sure how to proceed further, any small help or hint could be of great help,Please please do help me why this still loads this :(

M. Deinum
  • 115,695
  • 22
  • 220
  • 224
user3729090
  • 25
  • 1
  • 8
  • 2
    Spring Cloud and Spring Boot are heavily tied together regarding versions. You cannot just upgrade Spring Boot when using Spring Cloud, you have to upgrade Spring Cloud as well. Also make sure that you aren't mixing versions of jars from Spring (Boot) or another dependency. – M. Deinum Apr 13 '22 at 06:23
  • I am struck here for the last 2 days, not sure of correct versions for spring boot 2.5.12, can you pls help me with any doc @M.Deinum pls I would be forever grateful – user3729090 Apr 13 '22 at 06:39
  • 1
    As stated Spring Boot and Spring Cloud are tightly coupled, so if you upgrade Boot yuou also need to upgrade cloud. If you didn't it won't work. Without seeing more of your application (the dependencies) this will be impossible to answer. – M. Deinum Apr 13 '22 at 06:46
  • 1
    The table that shows Spring Boot and Spring Cloud compatible versions is on this page: https://spring.io/projects/spring-cloud – Scott Frederick Apr 14 '22 at 21:14
  • @M.Deinum I have added my dependencies list, can you please help me why this thing is not working, i have changed my cloud version to 2020.0.5 as specified.I am seriously clueless of why this is occuring, Please help – user3729090 Apr 18 '22 at 17:20
  • 3
    For starters stop with all the exclusions and manually inclusions... That will only make things worse. – M. Deinum Apr 19 '22 at 05:31
  • I faced the same problem when using latest spring boot version with `io.github.resilience4j` dependencies. Spring boot actuator dependency need to be added to pom file but that alone did not resolve the error so I also had to check the resilience4j dependencies. https://stackoverflow.com/questions/60587334/getting-compatible-version-issue-when-running-spring-boot-application-however-in – firstpostcommenter May 26 '22 at 07:31

2 Answers2

0

Check if you have resilience4j-spring-boot2 dependency. Update that to 1.7.0

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Aug 05 '23 at 08:22
-2

Please try this, its worked for us

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
        <exclusions>
            <exclusion>
                <groupId>io.micrometer</groupId>
                <artifactId>micrometer-core</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>io.micrometer</groupId>
        <artifactId>micrometer-core</artifactId>
        <version>1.7.10</version>
        <scope>compile</scope>
    </dependency>
  • 1
    If you want another version of micrometer use the proper mechanism and not an exclusion and added dependency. – M. Deinum Apr 19 '22 at 05:28