hadoop:slf4j:类路径包含多个slf4j绑定

rslzwgfq  于 2021-06-01  发布在  Hadoop
关注(0)|答案(0)|浏览(470)

我正在运行一个简单的map reduce程序,输出为avro文件。在本地模式下运行时,我得到slf4j绑定警告,它阻止显示日志详细信息。这使得我很难在本地模式下测试我的更改。
以下是项目相关性:

<dependencies>
        <dependency>
            <groupId>org.apache.hadoop</groupId>
            <artifactId>hadoop-mapreduce-client-common</artifactId>
            <version>2.6.0-cdh5.8.5</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.hadoop</groupId>
            <artifactId>hadoop-mapreduce-client-core</artifactId>
            <version>2.6.0-cdh5.8.5</version>
        </dependency>
        <dependency>
            <groupId>org.apache.hadoop</groupId>
            <artifactId>hadoop-mapreduce-client-jobclient</artifactId>
            <version>2.6.0-cdh5.8.5</version>
        </dependency>
           <dependency>
            <groupId>org.apache.avro</groupId>
            <artifactId>avro</artifactId>
            <version>1.7.6-cdh5.8.3</version>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-log4j12</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.avro</groupId>
            <artifactId>avro-mapred</artifactId>
            <version>1.7.6-cdh5.8.3</version>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-log4j12</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.avro</groupId>
            <artifactId>avro-tools</artifactId>
            <version>1.7.6-cdh5.8.3</version>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-log4j12</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>

从其他堆栈跟踪日志中,我对依赖项进行了检查:

mvn dependency:tree -Dverbose -Dincludes=org.slf4j

得到了下面的树:

[INFO] +- org.apache.hadoop:hadoop-mapreduce-client-common:jar:2.6.0-cdh5.8.5:provided (scope not updated to compile)
[INFO] |  +- (org.slf4j:slf4j-api:jar:1.7.5:compile - scope updated from provided; omitted for duplicate)
[INFO] |  \- (org.slf4j:slf4j-log4j12:jar:1.7.5:compile - scope updated from provided; omitted for duplicate)
[INFO] +- org.apache.hadoop:hadoop-mapreduce-client-core:jar:2.6.0-cdh5.8.5:compile
[INFO] |  +- org.apache.hadoop:hadoop-yarn-common:jar:2.6.0-cdh5.8.5:compile
[INFO] |  |  \- (org.slf4j:slf4j-api:jar:1.7.5:compile - omitted for duplicate)
[INFO] |  +- org.slf4j:slf4j-api:jar:1.7.5:compile
[INFO] |  \- org.slf4j:slf4j-log4j12:jar:1.7.5:compile
[INFO] |     \- (org.slf4j:slf4j-api:jar:1.7.5:compile - omitted for duplicate)
[INFO] \- org.apache.hadoop:hadoop-mapreduce-client-jobclient:jar:2.6.0-cdh5.8.5:compile
[INFO]    +- org.apache.hadoop:hadoop-mapreduce-client-shuffle:jar:2.6.0-cdh5.8.5:compile
[INFO]    |  +- org.apache.hadoop:hadoop-yarn-server-common:jar:2.6.0-cdh5.8.5:compile
[INFO]    |  |  \- org.apache.zookeeper:zookeeper:jar:3.4.5-cdh5.8.5:compile
[INFO]    |  |     +- (org.slf4j:slf4j-api:jar:1.7.5:compile - omitted for duplicate)
[INFO]    |  |     \- (org.slf4j:slf4j-log4j12:jar:1.7.5:compile - omitted for duplicate)
[INFO]    |  +- org.apache.hadoop:hadoop-yarn-server-nodemanager:jar:2.6.0-cdh5.8.5:compile
[INFO]    |  |  \- (org.slf4j:slf4j-api:jar:1.7.5:compile - omitted for duplicate)
[INFO]    |  +- (org.slf4j:slf4j-api:jar:1.7.5:compile - omitted for duplicate)
[INFO]    |  \- (org.slf4j:slf4j-log4j12:jar:1.7.5:compile - omitted for duplicate)
[INFO]    +- (org.slf4j:slf4j-api:jar:1.7.5:compile - omitted for duplicate)
[INFO]    \- (org.slf4j:slf4j-log4j12:jar:1.7.5:compile - omitted for duplicate)

它看起来不错,但没有从运行中获得错误或信息。
修复这个多重绑定还需要什么?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题