spring boot配置zipkin时发生的问题

近段时间被这个问题折磨了很久,进入正题:

pom.xml开始时的依赖

 <dependency>
            <groupId>io.zipkin.java</groupId>
            <artifactId>zipkin</artifactId>
            <version>2.10.1</version>
        </dependency>
        <dependency>
            <groupId>io.zipkin.java</groupId>
            <artifactId>zipkin-server</artifactId>
            <version>2.10.1</version>
        </dependency>
        <dependency>
            <groupId>io.zipkin.java</groupId>
            <artifactId>zipkin-autoconfigure-ui</artifactId>
            <version>2.10.1</version>
        </dependency>

出现问题:The bean ‘characterEncodingFilter’, defined in class path resource [zipkin/autoconfigure/ui/ZipkinUiAutoConfiguration.class], could not be registered. A bean with that name has already been defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/HttpEncodingAutoConfiguration.class] and overriding is disabled.
spring boot配置zipkin时发生的问题_第1张图片

解决方案:把zipkin-autoconfigure-ui的版本改成如下:即可解决问题


        <dependency>
            <groupId>io.zipkin.java</groupId>
            <artifactId>zipkin-autoconfigure-ui</artifactId>
            <version>2.12.3</version>
        </dependency>

如果碰到启动后无法访问页面的情况,也可以试一下以上方法。

你可能感兴趣的:(springboot)