我们在使用日志记录网站或者应用时,有时候启动会出现这个告警:

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation

但是并不影响程序运行。可是看着心烦,现在发分享一下消除这个告警的方法。

原因:

  我是在log4j的时候遇到这个问题的。首先引起这个问题的原因一眼就可以看出来,就是没有找 StaticLoggerBinder 这个类。

那解决方案就是,找到这个类所在的包,然后引入这个包就可以了。

  另外,官网给出了这个问题更具体的说明:

This warning message is reported when the org.slf4j.impl.StaticLoggerBinder
class could not be loaded into memory. This happens when no appropriate SLF4J
binding could be found on the class path. Placing one (and only one) of
slf4j-nop.jar slf4j-simple.jar, slf4j-log4j12.jar, slf4j-jdk14.jar or
logback-classic.jar on the class path should solve the problem.

  翻译一下就是:当java虚拟机想要把 org.slf4j.impl.StaticLoggerBinder 这个类载入内存时,但是在我们项目的class path中又找不到

这个类是,就会报这个warning信息。将 slf4j-nop.jar slf4j-simple.jar, slf4j-log4j12.jar, slf4j-jdk14.jar 或者 logback-classic.jar 其中的一个

放到我们的class path中就可以解决这个问题。

解决:

  上述翻译已经给出了解决方案。我解决的方式是找了一个slf4j-simple-1.7.7.jar把放到我的class path中,再次运行程序就没有这个问题了。

解决 Failed to load class "org.slf4j.impl.StaticLoggerBinder"的更多相关文章

  1. 解决Failed to load class "org.slf4j.impl.StaticLoggerBinder"

    Hibernate使用SLF4J API记录日志,所以在Hibernate的lib中,不再提供Log4J的包,而大部分框架依然使用Log4J记录日志,这样导致了兼容性问题. 解决办法,两步: 一.在编 ...

  2. 解决执行maven项目出现 SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”. error

    最近再弄maven项目,运行起来没有问题,但是Console控制台会报错,比如说如下的问题异常提示: 由此我们可以看出,报出错误的地方主要是slf4j的jar包,而故障码中“Failed to loa ...

  3. 解决 程序报 SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". 错误

    调试程序出现如下错误: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".SLF4J: Default ...

  4. SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".错误的解决方法

    1.今天新git下来的项目报错如下: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".SLF4J: ...

  5. Kafka生产者案例报警告SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".

    一.SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". 这个报警告的原因简单来说时因为slf4j的版本 ...

  6. 解执行maven项目出现 SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”. error

    最近再弄maven项目,运行起来没有问题,但是Console控制台会报错,比如说如下的问题异常提示: 由此我们可以看出,报出错误的地方主要是slf4j的jar包,而故障码中“Failed to loa ...

  7. kafka 报Failed to load class "org.slf4j.impl.StaticLoggerBinder".[z]

    转:http://blog.chinaunix.net/uid-25135004-id-4172954.html 测试kafka    producer发送消息 和  consumer 接受消息报错 ...

  8. Failed to load class "org.slf4j.impl.StaticLoggerBinder"

    调试程序出现如下错误: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".SLF4J: Default ...

  9. Failed to load class “org.slf4j.impl.StaticLoggerBinder”

    背景: 在配置使用Hibernate的时候遇到了这个问题, 然后就很头疼. SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerB ...

随机推荐

  1. 学会如何使用shiro

    摘:https://www.cnblogs.com/learnhow/p/5694876.html 一.架构 要学习如何使用Shiro必须先从它的架构谈起,作为一款安全框架Shiro的设计相当精妙.S ...

  2. MySQLdb-python安装

    安装很简单,步骤如下: 前期:yum -y install python-setuptools,或者自己网上找源码包安装 1. 下载安装包: #wget  https://pypi.python.or ...

  3. 【串线篇】Mybatis之动态sql

    一.if标签 <select id="getTeacherByCondition" resultMap="teacherMap"> select * ...

  4. hibernate 5原生sql查询测试学习代码

    基本查询 import java.util.List; import org.hibernate.SQLQuery; import org.hibernate.Session; import org. ...

  5. restful接口风格

    一.定义 REST全称是Representational State Transfer, 中文意思是表述性状态转移. REST指的是一组架构约束条件和原则,如果一个架构符合REST的约束条件和原则,我 ...

  6. 【leetcode】1017. Convert to Base -2

    题目如下: Given a number N, return a string consisting of "0"s and "1"s that represe ...

  7. 【leetcode】1020. Partition Array Into Three Parts With Equal Sum

    题目如下: Given an array A of integers, return true if and only if we can partition the array into three ...

  8. Python爬虫之抓图

    从"百度图片(http://image.baidu.com/)"的首页下载图片 # -*- coding: utf-8 -*- import urllib import re im ...

  9. paper 168: 2018-FATTEN 论文解析-feature space transfer for data augmentation

    paper download:https://arxiv.org/abs/1801.04356 本文的核心就是使用GAN网络生成新的数据. 这个总体框图,常规结构,具体是通过在appearance和p ...

  10. ARC093 F Dark Horse——容斥

    题目:https://atcoder.jp/contests/arc093/tasks/arc093_d #include<cstdio> #include<cstring> ...