maven项目启动报错:SLF4J: Class path contains multiple SLF4J bindings.
SringBoot的Application启动报错:
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/G:/.m2/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/G:/.m2/repository/org/slf4j/slf4j-log4j12/1.7.21/slf4j-log4j12-1.7.21.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 [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
原因:logback-classic包和slf4j包冲突。
解决方法:
找到哪个依赖引入了logback-classic,然后用依赖排除标签排除掉。
具体解决:
其中slf4j-log4j12包是我在pom中引入的,说明logback-classic包是其他依赖中引用的。在pom文件的Depency Hierarchy页签中,找到:
是spring-boot-starter-jdbc包引入的。
(也可以用mvn dependency:tree
命令查看依赖关系)
在pom中排除掉:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId> <!--排除-->
<exclusions>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
</exclusions> </dependency>
maven项目启动报错:SLF4J: Class path contains multiple SLF4J bindings.的更多相关文章
- maven项目启动报错;class path resource [com/ssm/mapping/] cannot be resolved to URL because it does not exist
项目启动报了一堆错误,其实都是class path resource [com/ssm/mapping/] cannot be resolved to URL because it does not ...
- eclipse 中导入 maven项目 启动报错
导入Maven项目到Eclipse中时,出现问题如下: java.lang.ClassNotFoundException: org.springframework.web.context.Contex ...
- maven项目报错:Class path contains multiple SLF4J bindings
maven项目编译不报错,运行时报错如下: SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [b ...
- 日志jar包冲突报错:Class path contains multiple SLF4J bindings
问题现象:tomcat启动卡死,报错日志如下: 十一月 07, 2017 8:35:45 下午 org.apache.catalina.core.ApplicationContext log 信息: ...
- Maven项目启动报错
错误信息如下: 六月 , :: 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin 警告: [SetPropertiesRule]{S ...
- 启动Maven项目启动报错:java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
tomcat在发布项目的时候没有同时发布maven依赖所添加的jar包,你需要设置一下eclipse:项目 -> 属性 -> Deployment Assembly -> Add - ...
- maven项目 启动报错:java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
tomcat在发布项目的时候没有同时发布maven依赖所添加的jar包,所以找不到解决方法:设置一下eclipse:项目 -> properties -> Deployment Assem ...
- Maven项目启动报错:org.springframework.web.filter.CharacterEncodingFilter cannot be cast to javax.servlet.Filter
看网上说法tomcat启动时会把lib目录下的jar包加载进内存,而项目里也有相同的jar包就会导致jar包冲突 解决办法: 把pom依赖里相应的jar包添加<scope>标签 <d ...
- Maven项目启动报错:java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
1.场景 1.1.先确认pom.xml文件已添加mysql依赖: <dependency> <groupId>mysql</groupId> < ...
随机推荐
- linux 使用ifstat查看网络使用情况
首先安装ifstat wget http://distfiles.macports.org/ifstat/ifstat-1.1.tar.gz tar xzvf ifstat-1.1.tar.gz cd ...
- 对actuator的管理端点进行ip白名单限制(springBoot添加filter)
在我们的SpringCloud应用中,我们会引入actuator来进行管理和监控我们的应用 常见的有:http://www.cnblogs.com/yangzhilong/p/8378152.html ...
- 使用Jenkins搭建持续集成(CI)环境
转自:http://www.cnitblog.com/luckydmz/archive/2012/01/03/77007.html 首先从官网http://jenkins-ci.org/下载 Java ...
- 【Android】Android的进程优先级
android对于所有进程的处理态度都是尽可能不杀死.然而,资源总共就那么多,要是对所有进程都保持宽容的话,资源总会有消耗殆尽的时候.因此,在内存不足的情况,android系统需要根据一定的策略,选择 ...
- 5 Protocols For Event-Driven API Architectures
The internet is a system of communication, and as such, the relationship between client and server, ...
- java File.separator 简介
在Windows下的路径分隔符和Linux下的路径分隔符是不一样的,当直接使用绝对路径时,跨平台会暴出“No such file or diretory”的异常. 比如说要在temp目录下建立一个te ...
- github建库不成功,不能用SVN上传
说明(2017-12-7 11:37:35): 1. 之前用SVN向gihub提交代码没有一点问题,昨天新建了一个仓库,结果死活提交不上去,以为是SVN的问题,折腾了一天都没弄好. 2. github ...
- CSS让页面平滑滚动
我们以往实现平滑滚动往往用的是jQuery, 如实现平滑回到顶部,就写如下代码: $('.js_go_to_top').click(function () { $(".js_scroll_a ...
- 【转】ELK 日志分析系统
大纲: 一.简介 二.Logstash 三.Redis 四.Elasticsearch 五.Kinaba 一.简介 1.核心组成 ELK由Elasticsearch.Logstash和Kibana三部 ...
- laravel项目composer安装
1.下载 Composer (https://pkg.phpcomposer.com/#how-to-install-composer) 安装前请务必确保已经正确安装了 PHP.打开命令行窗口并执行 ...