zipkin错误创建类路径资源中定义的名称为“webMvcMetricsFilter”的bean时出错

问题描述 投票:0回答:2

当我尝试集成 zipkin 时。它引发了这个错误

Error Msg:Error starting Tomcat context. Exception: org.springframework.beans.factory.UnsatisfiedDependencyException. Message: Error creating bean with name 'webMvcMetricsFilter' defined in class path resource [org/springframework/boot/actuate/autoconfigure/metrics/web/servlet/WebMvcMetricsAutoConfiguration.class]: Unsatisfied dependency expressed through method 'webMvcMetricsFilter' parameter 0;
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'prometheusMeterRegistry' defined in class path resource [org/springframework/boot/actuate/autoconfigure/metrics/export/prometheus/PrometheusMetricsExportAutoConfiguration.class]: Initialization of bean failed;
nested exception is org.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

版本:

  • Springboot 2.2.4
  • SpringCloud Hoxton.SR1(侦探:2.2.1)
  • 拉链2.19.9
@EnableZipkinServer
@SpringBootApplication
public class C4ZipkinApplication {

    public static void main(String[] args) {
        SpringApplication.run(C4ZipkinApplication.class, args);
    }

}
<dependency>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
   <groupId>io.zipkin.java</groupId>
   <artifactId>zipkin-server</artifactId>
</dependency>
<dependency>
   <groupId>io.zipkin.java</groupId>
   <artifactId>zipkin-autoconfigure-ui</artifactId>
</dependency>
spring-boot spring-cloud zipkin
2个回答
0
投票

您的应用程序在 Tomcat 服务器中启动,但 Zipkin 使用另一台服务器,但我不知道该名称,我将此代码包含到 spring boot starter web dependency 中以忽略 tomcat 服务器

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

这对我有用,试试吧


0
投票

如果您使用配置服务器,请记住在运行微服务之前运行它。

© www.soinside.com 2019 - 2024. All rights reserved.