开发者社区 问答 正文

SLF4J: Class path contains multiple SLF4?报错

IntelliJ IDEA -- Run/Debug configuration -- Gradle Task jettyRun报错, 但正常在命令行./gradlew jettyRun正常!

IntelliJ IDEA -- Run/Debug configuration -- Gradle Task jettyRun

报错信息:

下午11:02:49: Executing external task 'jettyRun'...

:common:compileJava UP-TO-DATE
:common:processResources UP-TO-DATE
:common:classes UP-TO-DATE
:common:jar UP-TO-DATE
:plugin:compileJava UP-TO-DATE
:plugin:processResources UP-TO-DATE
:plugin:classes UP-TO-DATE
:plugin:jar UP-TO-DATE
❌compileJava UP-TO-DATE
❌processResources UP-TO-DATE
❌classes UP-TO-DATE
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/gameover/.gradle/wrapper/dists/gradle-2.6-all/2j4sg4877lcsg31diboouhun8/gradle-2.6/lib/gradle-core-2.6.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/gameover/.m2/repository/org/slf4j/slf4j-log4j12/1.7.5/slf4j-log4j12-1.7.5.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.slf4j.impl.Log4jLoggerFactory]
log4j:WARN No appenders could be found for logger (org.apache.ibatis.logging.LogFactory).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Could not execute build using Gradle distribution 'https://services.gradle.org/distributions/gradle-2.6-all.zip'.

下午11:03:24: External task execution finished 'jettyRun'.

./gradlew jettyRun

信息 但可以运行成功!

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/gameover/.gradle/wrapper/dists/gradle-2.6-all/2j4sg4877lcsg31diboouhun8/gradle-2.6/lib/gradle-core-2.6.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/gameover/.m2/repository/org/slf4j/slf4j-log4j12/1.7.5/slf4j-log4j12-1.7.5.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.slf4j.impl.Log4jLoggerFactory]


BUILD SUCCESSFUL


Total time: 16.098 secs
<div>
	<br>
</div>


展开
收起
爱吃鱼的程序员 2020-06-10 13:37:03 719 分享 版权
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB
    multipleSLF4Jbindings我知,这两个包怎么处理?gradle-2.6sla4j有高手能指点下吗?

    http://www.slf4j.org/codes.html#multiple_bindings  

    警告而已嘛,没多大关系

    没用过 gradle-core-2.6.jar看名字是gradle的核心包 不知道这个包会有Logger。

    真要处理就去掉 slf4j-log4j12-1.7.5.jar这个包

    嗯,就是想找个方法处理上,如果去掉slf4j-log4j就报错了!
    2020-06-10 13:37:21
    赞同 展开评论
问答分类:
问答地址: