SLF4J:无法加载类“org.slf4j.impl.StaticLoggerBinder”。错误 [英] SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". error

查看:139
本文介绍了SLF4J:无法加载类“org.slf4j.impl.StaticLoggerBinder”。错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


  • 关于Eclipse IDE (靛蓝 Juno 开普勒(32和64位版本))

  • 平台 Windows Ubuntu Mac

  • m2e版本 1.1.0.20120530-0009 1.2.0.20120903-1050 1.3.0.20130129-0926

    1.4.0.20130601-0317

  • Regarding Eclipse IDE (Indigo, Juno and Kepler (32 and 64 bit versions))
  • Platforms: Windows, Ubuntu, Mac
  • m2e version: 1.1.0.20120530-0009, 1.2.0.20120903-1050, 1.3.0.20130129-0926,
    1.4.0.20130601-0317

将m2e更新为1.1后,出现上述错误。 通过删除m2e 1.1并回滚到m2e 1.0,一切正常。 我试图重复Windows和Ubuntu中的问题,它给了我完全相同的错误。测试了slf4j-api和logback的大量配置,但似乎没有效果。

The above error came after updating the m2e to version 1.1. By removing m2e 1.1 and rolling back to m2e 1.0 everything worked fine. I tried to repeat the problem in Windows and Ubuntu and it gave me the exact same error. Numerous configurations of the slf4j-api and logback were tested but none seem to work.

即使没有声明slf4j依赖关系,任何maven项目都会出现该错误。

The error appears in any maven project even without declaring slf4j dependency.


  • 新的Maven项目 - > maven-archetype-quickstart

  • New Maven Project--> maven-archetype-quickstart

新的Maven项目 - >没有原型选择的简单项目

New Maven Project--> Simple project without archetype selection

结果为

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".






测试环境和配置



在Mac上使用Eclipse Indigo和Eclipse Juno(32位和64位)测试,Ubuntu为32位,Windows上为64位和32位。测试新安装的 Juno Classic Juno建模工具开普勒标准开普勒建模工具并产生了相同的错误。


Testing enviroments and configurations

Tested with Eclipse Indigo and Eclipse Juno (32 and 64 bit both) on Mac, 32 bit on Ubuntu and 64 and 32 bit on Windows. Tested fresh installs of Juno Classic, Juno Modelling tools, Kepler Standard, Kepler Modelling Tools and produced the same error.

出现清洁安装测试部署生成源验证编译 / strong>,验证和目标清除与其余目标的组合。它也出现在参数 -e -X 之间。试图删除m2e仓库并从头开始下载但是再次没有成功。我应该提到它已经在3种不同的机器和虚拟盒子上测试了所有上述系统,但它产生了相同的错误。

The error appears with clean, install, test, deploy, generate-sources, validate , compile , package, integration-test, verify and combinations of the goal clean with the rest goals. It appears also with parameters -e and -X. There was an attempt to delete the m2e repository and download it from scratch but again without success. It should me mentioned that it was tested in 3 different machines and virtual box all the above systems but it produced the same error.

尝试解决 slf4j-api 的所有不同的 logback 配置(从1.0.4到1.0.13)和 logback-core 依赖关系,但都产生相同的错误:

Tried all different logback configurations (from 1.0.4 to 1.0.13) that resolve the slf4j-api and logback-core dependencies, but all produce the same error:

<dependency>
   <groupId>ch.qos.logback</groupId>
   <artifactId>logback-classic</artifactId>
   <version></version>
</dependency>

尝试所有不同的(从1.6.1到1.7.5) slf4j-simple 配置。

Tried all different (from 1.6.1 to 1.7.5 ) slf4j-simple configurations.

<dependency>
   <groupId>org.slf4j</groupId>
   <artifactId>slf4j-simple</artifactId>
   <version></version>
   <scope>compile</scope>
</dependency>

尝试所有不同的(从1.6.1到1.7.5) log4j-over-slf4j

Tried all different (from 1.6.1 to 1.7.5 ) log4j-over-slf4j configurations.

<dependency>
   <groupId>org.slf4j</groupId>
   <artifactId>log4j-over-slf4j</artifactId>
   <version></version>
   <scope>compile</scope>
</dependency>

尝试所有不同的(从1.6.1到1.7.5) slf4j-jdk14 配置。

Tried all different (from 1.6.1 to 1.7.5 ) slf4j-jdk14 configurations.

<dependency>
   <groupId>org.slf4j</groupId>
   <artifactId>slf4j-jdk14</artifactId>
   <version></version>
   <scope>compile</scope>
</dependency>

尝试所有不同的(从1.6.1到1.7.5) slf4j-log4j12 配置。

Tried all different (from 1.6.1 to 1.7.5 ) slf4j-log4j12 configurations.

<dependency>
     <groupId>org.slf4j</groupId>
     <artifactId>slf4j-log4j12</artifactId>
     <version></version>
     <scope>compile</scope>
</dependency>

尝试 slf4j-nop 1.7.5 配置。

<dependency>
  <groupId>org.slf4j</groupId>
  <artifactId>slf4j-nop</artifactId>
  <version>1.7.5</version>
  <scope>compile</scope>
</dependency>

最后但并非最不重要的是,尽管发生错误,但是保存和打印日志。 / em>


  • 下载Eclipse Juno,Indigo或Kepler 32或64位(所有安装将
    导致相同的错误)。

  • Download Eclipse Juno, Indigo or Kepler 32 or 64 bit (All installations will cause the same error).


  • 安装m2e - Eclipse的Maven集成

  • Install m2e - Maven Integration for Eclipse

  • Juno - http://download.eclipse.org/releases/juno
  • Kepler - http://download.eclipse.org/releases/kepler
  • Indigo - http://download.eclipse.org/technology/m2e/releases/ (currently unavailable)

OR

将您的m2e版本更新为 1.1.0.20120530-0009 ,或 1.2.0.20120903-1050 1.3.0.20130129-0926 1.4.0.20130601-0317

Update your m2e version to 1.1.0.20120530-0009, or 1.2.0.20120903-1050, or 1.3.0.20130129-0926, or 1.4.0.20130601-0317 )

选择File-> New-> Other-> Maven Project->点击Next->选择

maven-archetype-从目录快速启动 - >完成

Select File->New->Other->Maven Project->Click Next->Select
maven-archetype-quickstart from the catalog->Finish

OR

选择File-> New-> Other-> Maven Project- >单击下一步 - >选择创建一个简单的项目(跳过原型选择) - >完成人工制品信息 - >完成

Select File->New->Other->Maven Project->Click Next->Select Create a simple project (skip archetype selection)-> Complete Artifact info-> Finish

控制台的第一行将会

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

现有项目将在将m2e版本更新为1.1.0.20120530-0009 之后产生相同的错误, 1.2.0.20120903-1050 1.3.0.20130129-0926 1.4.0.20130601-0317


编辑

m2e支持网站:


  • 上述问题已发布为m2e支持网站的错误,Igor Fedorenko的答案是

  • The above question was posted as a bug in m2e support site and the answer from Igor Fedorenko was that


没有立即计划禁止此消息。

There are no immediate plans to suppress this message.

要查看上述错误,请参阅 m2e官方支持网站

For viewing the above bug please refer to m2e official support site



编辑2


  • 上述错误指示是存在也是 m2e 版本 1.2.0.20120903-1050

  • The above error indication is present also to m2e version 1.2.0.20120903-1050



编辑3


  • 上述错误指示存在也是 m2e 版本 1.3.0.20130129-0926

  • The above error indication is present also to m2e version 1.3.0.20130129-0926



编辑4


  • 上述错误指示存在也为 m2e 版本 1.4.0.20130601-0317

  • The above error indication is present also to m2e version 1.4.0.20130601-0317

< hr>
编辑5

                              ***Reported FIXED***




  • 上述错误报告为 m2e 版本的固定版本 1.5.0 / Luna M3 目标里程碑)。该版本尚未下载。

  • Luna M3 定于11月15日

  • 最新的dev版本可用这里

  • 有关您可以在 m2e主存储库

    • The above error is reported as fixed for m2e version 1.5.0/Luna M3(Target Milestone). The version is not yet available for download.
    • Luna M3 is scheduled for Nov. 15th.
    • Latest dev build are available here
    • More information about the m2e milestones you can find at the m2e main repository.
    • 推荐答案

      我也可以确认此错误。

      I can also confirm this error.

      解决方法是在m2eclipse中使用 external maven ,而不是嵌入maven。

      Workaround: is to use external maven inside m2eclipse, instead of it's embedded maven.

      这是在三个步骤中完成的:

      1 在本地机器上安装maven (测试机是Ubuntu 10.10)

      1 Install maven on local machine (the test-machine was Ubuntu 10.10)


      mvn --version

      mvn --version

      Apache Maven 2.2.1(rdebian-4)Java版本:1.6.0_20 Java home:
      / usr / lib / jvm / java-6-openjdk / jre默认语言环境:de_DE,平台
      编码:UTF-8操作系统名称:linux版本:2.6.35-32-genericarch:
      amd64系列:unix

      Apache Maven 2.2.1 (rdebian-4) Java version: 1.6.0_20 Java home: /usr/lib/jvm/java-6-openjdk/jre Default locale: de_DE, platform encoding: UTF-8 OS name: "linux" version: "2.6.35-32-generic" arch: "amd64" Family: "unix"

      2从外部运行maven 链接如何运行maven从控制台

      2 Run maven externally link how to run maven from console


      > cd path-to-pom.xml
      > mvn test
      




          [INFO] Scanning for projects...
          [INFO] ------------------------------------------------------------------------
          [INFO] Building Simple
          [INFO]    task-segment: [test]
          [INFO] ------------------------------------------------------------------------
          [...]
          [INFO] Surefire report directory: [...]/workspace/Simple/target/surefire-reports
      
          -------------------------------------------------------
           T E S T S
          -------------------------------------------------------
          Running net.tverrbjelke.experiment.MainAppTest
          Hello World
          Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.042 sec
      
          Results :
      
          Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
      
          [INFO] ------------------------------------------------------------------------
          [INFO] BUILD SUCCESSFUL
          [INFO] ------------------------------------------------------------------------
          [...]
      

      3 in m2eclipse:嵌入的maven 切换到本地maven

      3 inside m2eclipse: switch from embedded maven to local maven


      • 找出本地maven家庭安装目录的地方(google为您的 MAVEN_HOME ,对于我来说,这帮助我,这是 / usr / share / maven2 窗口 - >首选项 - > Maven->安装 - >输入该字符串中的
      • 。那么你应该已经切换到你的新的外部maven。

      • 然后运行你的项目,例如。 maven测试。

      • find out where local maven home installation dir is (google for your MAVEN_HOME, for me this helped me that is /usr/share/maven2 )
      • in eclipse Menu->Window->Preferences->Maven->Installation-> enter that string. Then you should have switched to your new external maven.
      • then run your Project as e.g. "maven test".

      错误消息应该消失。

      这篇关于SLF4J:无法加载类“org.slf4j.impl.StaticLoggerBinder”。错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆