zoukankan      html  css  js  c++  java
  • Failed to load class org.slf4j.impl.StaticLoggerBinder的解决办法

    官网提供的解决办法

    Failed to load class org.slf4j.impl.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.

    since 1.6.0 As of SLF4J version 1.6, in the absence of a binding, SLF4J will default to a no-operation (NOP) logger implementation.

    If you are responsible for packaging an application and do not care about logging, then placing slf4j-nop.jar on the class path of your application will get rid of this warning message. Note that embedded components such as libraries or frameworks should not declare a dependency on any SLF4J binding but only depend on slf4j-api. When a library declares a compile-time dependency on a SLF4J binding, it imposes that binding on the end-user, thus negating SLF4J's purpose.

    翻译:

    这个警告消息是在org .slf4j. impl中报告的。不能将StaticLoggerBinder类加载到内存中。当在类路径上没有适当的SLF4J绑定时,会发生这种情况。放置一个(而且只有一个)slf4j - nop。jar slf4j-simple。slf4j-log4j12 jar。slf4j-jdk14 jar。jar或logback-classic。在类路径上的jar应该解决这个问题。

    因为在没有绑定的情况下,SLF4J版本1.6的1.6.0版本将默认为无操作(NOP)logger实现。

    如果您负责打包应用程序,而不关心日志记录,那么就放置slf4j - nop。在应用程序的类路径上的jar将删除此警告消息。请注意,诸如库或框架之类的嵌入式组件不应该声明对任何SLF4J绑定的依赖,但只依赖于SLF4J - api。当一个库声明一个对SLF4J绑定的编译时依赖时,它会对最终用户施加约束,从而否定SLF4J的目的。

    需要注意的其他部分

    可查看引用https://www.cnblogs.com/JamKong/p/4841591.html

    和scope的范围取值也有关系

    附录:

    在POM 4中,<dependency>中还引入了<scope>,它主要管理依赖的部署。目前<scope>可以使用5个值: 

        * compile,缺省值,适用于所有阶段,会随着项目一起发布。 
        * provided,类似compile,期望JDK、容器或使用者会提供这个依赖。如servlet.jar。
        * runtime,只在运行时使用,如JDBC驱动,适用运行和测试阶段。 
        * test,只在测试时使用,用于编译和运行测试代码。不会随项目发布。 
        * system,类似provided,需要显式提供包含依赖的jar,Maven不会在Repository中查找它。

  • 相关阅读:
    Github的基本使用
    Java Web工程搭建方法
    程序中使用百度地图
    Flutter 依赖的那些事儿
    Flutter Widgets (Container/Row/Column/Image)
    Flutter 安装
    UWP FillRowViewPanel
    UWP Composition API
    UWP Composition API
    UWP Jenkins + NuGet + MSBuild 手把手教你做自动UWP Build 和 App store包
  • 原文地址:https://www.cnblogs.com/awomanofsin/p/7986235.html
Copyright © 2011-2022 走看看