grpc-ecosystem / grpc-spring

Spring Boot starter module for gRPC framework.
https://grpc-ecosystem.github.io/grpc-spring/
Apache License 2.0
3.43k stars 809 forks source link

When spring-boot-starter-actuator was introduced, a bug appeared #1059

Closed loong024 closed 4 months ago

loong024 commented 4 months ago

Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled. 2024-02-23T10:01:20.240+08:00 ERROR 39100 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :


APPLICATION FAILED TO START


Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

net.devh.boot.grpc.client.metrics.MetricsClientInstruments.newClientMetricsMeters(MetricsClientInstruments.java:72)

The following method did not exist:

'io.micrometer.core.instrument.Meter$MeterProvider io.micrometer.core.instrument.Counter$Builder.withRegistry(io.micrometer.core.instrument.MeterRegistry)'

The calling method's class, net.devh.boot.grpc.client.metrics.MetricsClientInstruments, was loaded from the following location:

jar:file:/Users/KohRong/.m2/repository/net/devh/grpc-client-spring-boot-starter/3.0.0.RELEASE/grpc-client-spring-boot-starter-3.0.0.RELEASE.jar!/net/devh/boot/grpc/client/metrics/MetricsClientInstruments.class

The called method's class, io.micrometer.core.instrument.Counter$Builder, is available from the following locations:

jar:file:/Users/KohRong/.m2/repository/io/micrometer/micrometer-core/1.11.8/micrometer-core-1.11.8.jar!/io/micrometer/core/instrument/Counter$Builder.class

The called method's class hierarchy was loaded from the following locations:

io.micrometer.core.instrument.Counter.Builder: file:/Users/KohRong/.m2/repository/io/micrometer/micrometer-core/1.11.8/micrometer-core-1.11.8.jar

Action:

Correct the classpath of your application so that it contains compatible versions of the classes net.devh.boot.grpc.client.metrics.MetricsClientInstruments and io.micrometer.core.instrument.Counter$Builder

Disconnected from the target VM, address: '127.0.0.1:50818', transport: 'socket'

Process finished with exit code 1

loong024 commented 4 months ago
org.springframework.boot spring-boot-starter-web net.devh grpc-spring-boot-starter 3.0.0.RELEASE org.springframework.boot spring-boot-starter-actuator
loong024 commented 4 months ago

spring-boot-starter-parent version: 3.1.8

loong024 commented 4 months ago

Tried

The version in question occurs when using the micrometer-core (1.11.8) that comes with spring-boot-starter-parent (3.1.8). The above problem occurs. The micrometer-core 1.12.3 version can be started normally by introducing it separately.

When upgrading to the spring-boot-starter-parent (3.2.2) version, it can start normally without introducing micrometer-core.