告警描述
告警顯示,在類路徑下包含了多個(gè)SLF4J的綁定,然后選擇了一個(gè)實(shí)現(xiàn)類。
[root@hm hook-bin]# ./import-hive.sh
Using Hive configuration directory [/opt/software/apache-hive-3.1.0-bin/conf]
Log file for import is /opt/software/apache-atlas-2.1.0/logs/import-hive.log
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/software/apache-hive-3.1.0-bin/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/software/hadoop-3.1.1/share/hadoop/common/lib/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.apache.logging.slf4j.Log4jLoggerFactory]
NEXT IT WILL IMPORT THE HIVE'S META DATA!
2023-06-06T08:46:38,950 INFO [main] org.apache.atlas.ApplicationProperties - Looking for atlas-application.properties in classpath
2023-06-06T08:46:38,954 INFO [main] org.apache.atlas.ApplicationProperties - Loading atlas-application.properties from file:/opt/software/apache-hive-3.1.0-bin/conf/atlas-application.properties
2023-06-06T08:46:38,995 INFO [main] org.apache.atlas.ApplicationProperties - Using graphdb backend 'janus'
2023-06-06T08:46:38,995 INFO [main] org.apache.atlas.ApplicationProperties - Using storage backend 'hbase2'
2023-06-06T08:46:38,995 INFO [main] org.apache.atlas.ApplicationProperties - Using index backend 'solr'
2023-06-06T08:46:38,995 INFO [main] org.apache.atlas.ApplicationProperties - Atlas is running in MODE: PROD.
2023-06-06T08:46:38,995 INFO [main] org.apache.atlas.ApplicationProperties - Setting solr-wait-searcher property 'true'
2023-06-06T08:46:38,996 INFO [main] org.apache.atlas.ApplicationProperties - Setting index.search.map-name property 'false'
2023-06-06T08:46:38,996 INFO [main] org.apache.atlas.ApplicationProperties - Setting atlas.graph.index.search.max-result-set-size = 150
2023-06-06T08:46:38,996 INFO [main] org.apache.atlas.ApplicationProperties - Property (set to default) atlas.graph.cache.db-cache = true
2023-06-06T08:46:38,996 INFO [main] org.apache.atlas.ApplicationProperties - Property (set to default) atlas.graph.cache.db-cache-clean-wait = 20
2023-06-06T08:46:38,996 INFO [main] org.apache.atlas.ApplicationProperties - Property (set to default) atlas.graph.cache.db-cache-size = 0.5
2023-06-06T08:46:38,996 INFO [main] org.apache.atlas.ApplicationProperties - Property (set to default) atlas.graph.cache.tx-cache-size = 15000
2023-06-06T08:46:38,996 INFO [main] org.apache.atlas.ApplicationProperties - Property (set to default) atlas.graph.cache.tx-dirty-size = 120
如何解決
方案一
根據(jù)項(xiàng)目的實(shí)際情況,刪除多余的JAR包,多個(gè)JAR包路徑如下:
/opt/software/apache-hive-3.1.0-bin/lib/log4j-slf4j-impl-2.10.0.jar
/opt/software/hadoop-3.1.1/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar
方案二
查看項(xiàng)目的POM文件中是否有重復(fù)的SLF4J引入,如何查看?:文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-764123.html
ROCKY@LAPTOP MINGW64 /d/02-工作空間/06-代碼空間/04-gitee/rills-atlas-2.1.0-rc3/addons/hive-bridge (master)
$ mvn dependency:tree
找到多余的SLF4J,然后將其排除:文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-764123.html
<dependency>
<groupId>net.vcus</groupId>
<artifactId>perf-case</artifactId>
<version>1.0.0</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
</exclusions>
</dependency>
到了這里,關(guān)于JAVA基礎(chǔ) - SLF4J: Class path contains multiple SLF4J bindings的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!