Hadoop Mapreduce作业中的OptionConverter.convertLevel错误

vsdwdz23  于 2023-01-12  发布在  Hadoop
关注(0)|答案(1)|浏览(176)

我在Hadoop集群中执行mapreduce作业时遇到了一个奇怪的错误。这个错误是间歇性的。有时它会使Map器失败,有时即使抛出错误也会成功。
2022-12-28 01:20:53,882 ERROR [main] org.apache.hadoop.mapred.YarnChild: Error running child : java.lang.NoSuchMethodError: org/apache/log4j/helpers/OptionConverter.convertLevel(Ljava/lang/String;Lorg/apache/logging/log4j/Level;)Lorg/apache/logging/log4j/Level; (loaded from file:/opt/hadoop-3.3.0/share/hadoop/common/lib/log4j-1.2.17.jar by sun.misc.Launcher$AppClassLoader@350ed555) called from class org.apache.log4j.config.PropertiesConfiguration (loaded from file:/data/hadoop/yarn/usercache/hdfs-user/appcache/application_1671477750397_6197/filecache/10/job.jar/job.jar by sun.misc.Launcher$AppClassLoader@350ed555).

成绩档案

plugins {
    id 'java'
    id "com.github.davidmc24.gradle.plugin.avro" version "1.3.0"
}
dependencies {
    compileOnly group: 'org.apache.hadoop', name: 'hadoop-client', version: '3.3.0'
    implementation group: 'org.apache.avro', name: 'avro', version: '1.8.1'
    implementation group: 'org.apache.avro', name: 'avro-mapred', version: '1.10.2'
    implementation group: 'io.netty', name: 'netty-buffer', version: '4.1.51.Final'
    implementation  group: 'joda-time', name: 'joda-time', version:'2.8.1'
    implementation group: 'org.javatuples', name: 'javatuples', version: '1.2'
    implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: '2.12.4'
    testImplementation group: 'junit', name: 'junit', version: "$junit4Version"
    implementation project(':libraries:java-dcl')
    implementation project(':libraries:sdp')

    testImplementation group: 'org.assertj', name: 'assertj-core', version: '3.6.1'
}

generateAvroJava {
    source("${projectDir}/src/main/avro")//sourcepath avrofile
}

// The alternative to below is to put all java that is dependent on scala (or on the java dependent on the scala) in the src/main/scala dir
// https://stackoverflow.com/questions/23261075/compiling-scala-before-alongside-java-with-gradle
sourceSets {
    main {
        java {
            srcDirs = ['src/main/java']
        }
    }
}
lf5gs5x2

lf5gs5x21#

我不得不在所有的内部库中使用org.apache.log4j.Logger包,并去掉其他的logger类,因为有很多文件需要修改。

相关问题