Spring boot 2 upgrade issue with actuator

二次信任 提交于 2019-12-11 08:07:16

问题


Config: springCloudVersion = 'Finchley.SR1' springBootVersion = '2.0.2.RELEASE'

Getting below error:

Caused by: java.lang.ClassNotFoundException: org.springframework.boot.actuate.metrics.CounterService

There is no CounterService class in this release of spring-starter-actuator-2.0.2.RELEASE?? Ref: https://docs.spring.io/spring-boot/docs/2.0.2.RELEASE/api/


回答1:


Yes, CounterService is been removed in SpringBoot 2.0.

We faced the same issue and we used MeterRegistry from micrometer instead of CounterService

    <dependency>
        <groupId>io.micrometer</groupId>
        <artifactId>micrometer-registry-prometheus</artifactId>
    </dependency>

Please refer migration guide here



来源:https://stackoverflow.com/questions/52543242/spring-boot-2-upgrade-issue-with-actuator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!