1. 程式人生 > >遇到Class path contains multiple SLF4J bindings.該如何解決?

遇到Class path contains multiple SLF4J bindings.該如何解決?

錯誤表現:
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/hbase/lib/slf4j-log4j12-1.6.4.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See 

http://www.slf4j.org/codes.html#multiple_bindings for an explanation.

含義為:
發生jar包衝突了:
分別為:
file:/usr/hbase/lib/slf4j-log4j12-1.6.4.jar!/org/slf4j/impl/StaticLoggerBinder.class
file:/usr/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class
移除其中一個jar包即可
解決方案:
使用下面命令:
/usr/hbase/lib rm slf4j-log4j12-1.6.4.jar
問題解決