ava.lang.noclassdeffounderror:无法初始化类org.apache.log4j.log4jloggerfactory此错误的原因是什么

ct2axkht  于 2021-06-21  发布在  Storm
关注(0)|答案(1)|浏览(402)

java.lang.noclassdeffounderror:无法初始化org.apache.log4j.log4jloggerfactory中的类org.apache.log4j.logger.getlogger(logger)。java:39)在kafka.utils.logging$class.logger(logging。scala:24)在kafka.consumer.simpleconsumer.logger$lzycompute(simpleconsumer。scala:35)在kafka.consumer.simpleconsumer.logger(simpleconsumer。scala:35)在kafka.utils.logging$class.info(logging。scala:77)在kafka.consumer.simpleconsumer.info(simpleconsumer。scala:35)在kafka.consumer.simpleconsumer.liftedtree1$1(simpleconsumer。scala:94)在kafka.consumer.simpleconsumer.kafka$consumer$simpleconsumer$$sendrequest(simpleconsumer。scala:83)在kafka.consumer.simpleconsumer.getoffsetsbefore(simpleconsumer。scala:149)在kafka.javaapi.consumer.simpleconsumer.getoffsetsbefore(simpleconsumer。scala:79)在org.apache.storm.kafka.kafkautils.getoffset(kafkautils。java:75)在org.apache.storm.kafka.kafkautils.getoffset(kafkautils。java:65)在org.apache.storm.kafka.partitionmanager.(分区管理器。java:103)在org.apache.storm.kafka.zkcoordinator.refresh(zkcoordinator。java:98)在org.apache.storm.kafka.zkcoordinator.getmymanagedpartitions(zkcoordinator。java:69)在org.apache.storm.kafka.kafkaspout.nexttuple(kafkaspout。java:129)在org.apache.storm.daemon.executor$fn\uu7990$fn\uu8005$fn\uu8036.invoke(executor。clj:648)在org.apache.storm.util$async\u loop$fn\u 624.invoke(util。clj:484)在clojure.lang.afn.run(afn。java:22)在java.lang.thread.run(线程。java:745)

11dmarpk

11dmarpk1#

尝试将依赖项添加到log4j中,但是您需要将它们从storm中排除,以避免我在注解上的链接中解释的冲突:

<dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-api</artifactId>
        <version>2.3</version>
    </dependency>
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-core</artifactId>
        <version>2.3</version>
    </dependency>
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-1.2-api</artifactId>
        <version>2.3</version>
    </dependency>
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-jcl</artifactId>
        <version>2.3</version>
    </dependency>
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-slf4j-impl</artifactId>
        <version>2.3</version>
    </dependency>

相关问题