【maven】排除maven中jar包依赖的解决过程 例子:spring cloud启动zipkin,报错maven依赖jar包冲突 Class path contains multiple SLF4J bindings.
一直对于maven中解决jar包依赖问题的解决方法纠结不清:
下面这个例子可以说明一个很简单的解决方法:
项目启动报错:
Connected to the target VM, address: '127.0.0.1:59412', transport: 'socket'
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/D:/document/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.10.0/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/D:/document/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Exception in thread "main" java.lang.StackOverflowError
解决方案:
直接看报错内容,可以看出 是log4j和logback-classic的jar包冲突。
最简单的解决方法:将最新添加的jar包依赖,依次删除,然后启动服务,查看是因为多增加了哪个jar包依赖之后,出现的jar包冲突问题。
找到之后,在pom.xml中排除掉即可:
<!-- zipkin服务端 -->
<dependency>
<groupId>io.zipkin.java</groupId>
<artifactId>zipkin-server</artifactId>
<version>2.10.1</version>
<!--排除-->
<exclusions>
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
</exclusion>
</exclusions>
</dependency>
当然,排除的过程也可能依旧报错,那你得看看是你新加的这个jar包里面是多依赖了报错的jar包里的哪一个。
注意也可能是
<!--排除-->
<exclusions>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
</exclusions>
注意:
<groupId>对应上方错误中的红色
<artifactId>对应上方错误中的蓝色
【maven】排除maven中jar包依赖的解决过程 例子:spring cloud启动zipkin,报错maven依赖jar包冲突 Class path contains multiple SLF4J bindings.的更多相关文章
- spring cloud启动zipkin,报错maven依赖jar包冲突 Class path contains multiple SLF4J bindings
项目启动报错: Connected to the target VM, address: '127.0.0.1:59412', transport: 'socket' SLF4J: Class pat ...
- maven项目启动报错:SLF4J: Class path contains multiple SLF4J bindings.
SringBoot的Application启动报错: SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding ...
- 日志jar包冲突报错:Class path contains multiple SLF4J bindings
问题现象:tomcat启动卡死,报错日志如下: 十一月 07, 2017 8:35:45 下午 org.apache.catalina.core.ApplicationContext log 信息: ...
- maven项目报错:Class path contains multiple SLF4J bindings
maven项目编译不报错,运行时报错如下: SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [b ...
- Springboot项目打成war包,部署到tomcat上,正常启动访问报错404
前言: 项目介绍,此项目是一个Maven多模块项目,模块项目:all(父模块):util (公用的工具类):dao(实体类.业务类.mapper.mapper.xml):business(业务serv ...
- 启动时候报错由于没有扫包 error creating bean with name
<!-- 扫描包,加载service实现类 --> <context:component-scan base-package="com.taotao.search.serv ...
- SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/D:/MyEclipseWorkSpace/Emps/WebRoot/WEB-INF/lib/slf4j-nop-1.5.6.
错误的是HQL语句,注意写类名属性名无误,条件无误.
- Eclipse中启动Tomcat报错:[There is insufficient memory for the Java Runtime Environment to continue.]的解决方案
1,报错截图 2,报错信息 五月 08, 2018 9:57:58 上午 org.apache.tomcat.util.digester.SetPropertiesRule begin 警告: [Se ...
- 【spring cloud】【IDEA】【Maven】spring cloud多模块打包,打包的jar包只有几k,jar包无法运行,运行报错:no main manifest attribute, in /ms-eureka.jar
======================================================================================== 引申:maven打包多 ...
随机推荐
- PHP性能调优---PHP-FPM配置及使用总结
PHP-FPM配置及使用总结: php-FPM是一个PHP FastCGI的管理器,它实际上就是PHP源代码的补丁,旨在将FastCGI进程管理引进到PHP软件包中,我们必须将其patch到PHP源代 ...
- Android发送短信界面
package com.example.wang.application1; import android.os.Bundle; import android.support.v7.app.AppCo ...
- CCF CSP 201403-3 命令行选项
CCF计算机职业资格认证考试题解系列文章为meelo原创,请务必以链接形式注明本文地址 CCF CSP 201403-3 命令行选项 问题描述 请你写一个命令行分析程序,用以分析给定的命令行里包含哪些 ...
- 【AtCoder】ARC094(C-F)题解
C - Same Integers 题解 要么三个都达到最大的数,要么三个都到达最大的数+1,判断是前一种情况的方法是不断垫高前两大的,看之后最小的那个和最大的那个差值是不是2的倍数 否则就是第二种情 ...
- 异常类Exception(String message, Throwable cause)中的cause理解
这个在构造函数里面竟然有一个Throwable,感觉有些奇怪. 1. Throwable cause 这里cause要传一个Throwable的子类异常进去么? 是引起这个异常的异常,如果这个值是空值 ...
- webstorm for ubuntu install
1. from https://www.tslang.cn/index.html#download-links downloading https://www.jetbrains.com/webst ...
- 再议js的传递和深复制
病理 基本类型的传递就是按值传递,比如说 var a = 1; var b = a; b = 3; console.log(a,b);//1,3 很明显,a的值并未因为b的值改变而变化,这是因为a只是 ...
- 线程池--ThreadPoolExecutor
线程池的实现原理 1)如果当前运行的线程少于corePoolSize,则创建新线程来执行任务(注意,执行这一步骤 需要获取全局锁). 2)如果运行的线程等于或多于corePoolSize,则将任务加入 ...
- CSUOJ 1270 Swap Digits
Description ) in the first line, which has the same meaning as above. And the number is in the next ...
- Spring技术内幕:设计理念和整体架构概述(转)
程序员都很崇拜技术大神,很大一部分是因为他们发现和解决问题的能力,特别是线上出现紧急问题时,总是能够快速定位和解决. 一方面,他们有深厚的技术基础,对应用的技术知其所以然,另一方面,在采坑的过程中不断 ...