jar包衝突:Found binding in [jar:file:/hadoop-2.7.2/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar

昨天因爲要在集羣上跑HBase程序的jar包,所以配置了HADOOP_CLASSPATH環境變量,但是今天啓動HDFS時就開始報

錯,錯誤信息如下:

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/hadoop-2.8.5/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/hbase-2.1.4/lib/client-facing-thirdparty/slf4j-log4j12-1.7.25.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]
解決方法:進入到對應的目錄,將兩個衝突的jar移除一個即可。我移除的是HBase的,只是改了下對應的文件名,也沒有刪問題就解決了。
提醒:你不要覺得這種方法暴力,其實這個文件是可以共用的,只需要有一個即可(原則上是保留高版本的)。還有就是網上有那種設置HBase不去訪問Hadoop的jar的,但是這種方法我試了不行,而且這種方法我覺得也不好。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章