SLF4J:ClasspathcontainsmultipleSLF4Jbindings

SLF4J: Class path contains multiple SLF4J bindings.

SLF4J: Found binding in [jar:file:/D:/Projects/Rainbow II/icod/WebRoot/WEB-INF/lib/logback-classic-1.0.13.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: Found binding in [jar:file:/D:/Projects/Rainbow II/icod/WebRoot/WEB-INF/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: Found binding in [jar:file:/D:/Program Files/Genuitec/MyEclipse Professional/plugins/com.genuitec.eclipse.j2eedt.core_11.0.1.me201306201512/data/libraryset/EE_6/bean-validator.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: Found binding in [jar:file:/D:/Program Files/Genuitec/MyEclipse Professional/plugins/com.genuitec.eclipse.j2eedt.core_11.0.1.me201306201512/data/libraryset/EE_6/weld-osgi-bundle.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: See #multiple_bindings for an explanation.

SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]


上面的情况是:

一个Web Project,用SpringJUnit启动测试,出现了四份binding。WEB lib里有2份,J2EE6的包里有两份,SLF4J取了第一个作为真实绑定。


在web下启动运行,J2EE6包里冲突就没有了,只剩下Web lib包里的2份binding,用logback就留下logback-classic-*.jar , 用log4j就留下slf4j-log4j12。


只是记录这个问题点,搜遍网络,没有找到办法。


可以这样理解,SLF4j是个标准的入口,他可以连接log4j也可以是logback,但他同时只能连接一个。

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/11281.html