配置: springCloudVersion ='Finchley.SR1' springBootVersion ='2.0.2.RELEASE'
出现以下错误:
Caused by: java.lang.ClassNotFoundException: org.springframework.boot.actuate.metrics.CounterService
此版本的spring-starter-actuator-2.0.2.RELEASE中没有CounterService类? 参考:https://docs.spring.io/spring-boot/docs/2.0.2.RELEASE/api/
答案 0 :(得分:3)
是的,CounterService已在SpringBoot 2.0中删除。
我们面临同样的问题,我们使用千分尺的MeterRegistry
代替了CounterService
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
请参阅迁移指南here