【问题标题】:Zipkin with Spring Boot 2.2 and Hoxton CloudZipkin 与 Spring Boot 2.2 和 Hoxton Cloud
【发布时间】:2020-04-08 18:02:41
【问题描述】:

我想将我的项目 Zipkin 设置更新为 Spring Boot 2.2.2.RELEASE 和 Spring Cloud Hoxton.RELEASE,但看起来简单的 jars 更新是不够的。

我认为旧设置(它适用于 Spring Boot 2.1.5.RELEASE 和 Greenwich.SR2)也适用于 Boot 2.2.2.RELEASE 和 Hoxton.RELEASE,但我似乎仍然错过了一些东西。

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.2.2.RELEASE</version>
        <relativePath/>
    </parent>

    <properties>
        ...
        <spring-cloud.version>Hoxton.RELEASE</spring-cloud.version>
<!--        <zipkin.version>2.12.9</zipkin.version> does not work either-->
        <zipkin.version>2.11.8</zipkin.version>
        ...  
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-zipkin</artifactId>
        </dependency>
        <dependency>
            <groupId>io.zipkin.java</groupId>
            <artifactId>zipkin-server</artifactId>
            <version>${zipkin.version}</version>
        </dependency>
        <dependency>
            <groupId>io.zipkin.java</groupId>
            <artifactId>zipkin-autoconfigure-ui</artifactId>
            <version>${zipkin.version}</version>
            <scope>runtime</scope>
        </dependency>
        ...
    </dependencies>

我收到以下异常 (java.lang.NoClassDefFoundError: zipkin2 /internal/Buffer$Writer):

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'webMvcMetricsFilter' defined in class path resource [org/springframework/boot/actuate/autoconfigure/metrics/web/servlet/We
bMvcMetricsAutoConfiguration.class]: Unsatisfied dependency expressed through method 'webMvcMetricsFilter' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pr
ometheusMeterRegistry' defined in class path resource [org/springframework/boot/actuate/autoconfigure/metrics/export/prometheus/PrometheusMetricsExportAutoConfiguration.class]: Initialization of bean failed; nested exception is or
g.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zipkin2.server.internal.ZipkinServerConfiguration': Unsatisfied dependency expressed through field 'httpQuery'; nested exception is org
.springframework.beans.factory.BeanCreationException: Error creating bean with name 'zipkin2.server.internal.ZipkinQueryApiV2': Bean instantiation via constructor failed; nested exception is java.lang.NoClassDefFoundError: zipkin2
/internal/Buffer$Writer

【问题讨论】:

  • 你解决了这个问题吗?
  • 这个问题你解决了吗
  • 不,我暂时把它停了下来,还没有更新。

标签: spring-boot spring-cloud zipkin


【解决方案1】:

这是版本问题。 Zipkin 官方推荐在spring-boot 2.x 之后使用zipkin-server instate 的客户服务器。

对我来说,2.12.9 库在 spring-boot 2.1.8.RELEASEspring-cloud Greenwich.SR6 下运行良好

【讨论】:

    猜你喜欢
    • 2019-02-01
    • 1970-01-01
    • 1970-01-01
    • 2021-02-23
    • 2020-09-14
    • 2020-05-18
    • 2020-12-30
    • 2021-10-26
    • 2020-09-03
    相关资源
    最近更新 更多