storm导致ignite log4j上的依赖冲突

3mpgtkmj  于 2021-06-24  发布在  Storm
关注(0)|答案(1)|浏览(388)

我尝试在storm集群上运行一个storm拓扑,拓扑jar是由提供的。在TopologyBolt中,我想从myignitecache模块中读取数据,但我遇到了以下错误。我认为依赖项(:/usr/hdp/2.6.0.3-8/storm/lib/log4j-slf4j-impl-2.8.jar:/usr/hdp/2.6.0.3-8/storm/lib/log4j-core-2.8)。jar:log4j)风暴的核心导致了ignite-log4j的冲突。
ava.lang.CompatibleClassChangeError:在java.lang.classloader.defineclass1(本机方法)~[?:1.8.0\u 112]在java.lang.classloader.defineclass1(classloader)实现类。java:763)~[?:1.8.0\u 112]位于java.security.secureclassloader.defineclass(secureclassloader。java:142)~[?:1.8.0112]在java.net.urlclassloader.defineclass(urlclassloader。java:467)~[?:1.8.0\u 112]在java.net.urlclassloader.access$100(urlclassloader。java:73)~[?:1.8.0\u 112]在java.net.urlclassloader$1.run(urlclassloader。java:368)~[?:1.8.0\u 112]在java.net.urlclassloader$1.run(urlclassloader。java:362)~[?:1.8.0112]在java.net.urlclassloader.findclass(urlclassloader)上的java.security.accesscontroller.doprivileged(本机方法)~[?:1.8.0\u 112]。java:361)~[?:1.8.0\u 112]位于java.lang.classloader.loadclass(classloader。java:424)~[?:1.8.0112]在sun.misc.launcher$appclassloader.loadclass(launcher。java:331)~[?:1.8.0112]在java.lang.classloader.loadclass(类加载器。java:357)在java.lang.class.forname0(本机方法)中~[?:1.8.0\u 112];在java.lang.class.forname(类)中~[?:1.8.0\u 112]。java:264)~[?:1.8.0\u 112]位于org.apache.ignite.internal.util.igniteutils.addlog4jnooplogger(igniteutils)。java:8366)~[stormjar.jar:?]在org.apache.ignite.internal.ignitionex.start(ignitionex。java:930)~[stormjar.jar:?]位于org.apache.ignite.internal.ignitionex.start(ignitionex。java:854)~[stormjar.jar:?]位于org.apache.ignite.internal.ignitionex.start(ignitionex。java:724)~[stormjar.jar:?]位于org.apache.ignite.internal.ignitionex.start(ignitionex。java:693)~[stormjar.jar:?]在org.apache.ignite.ignition.start(点火。java:352)~[stormjar.jar:?]
我的storm拓扑模块的依赖树如下所示

<p>
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building mytopology-enrichment 1.1
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ mytopology-enrichment---
[INFO] com.my.storm:mytopology-enrichment:jar:1.1
[INFO] +- org.apache.storm:flux-core:jar:1.1.0:compile
[INFO] |  \- commons-cli:commons-cli:jar:1.2:compile
[INFO] +- org.apache.storm:flux-wrappers:jar:1.1.0:compile
[INFO] |  +- org.apache.storm:multilang-javascript:jar:1.1.0:compile
[INFO] |  +- org.apache.storm:multilang-ruby:jar:1.1.0:compile
[INFO] |  \- org.apache.storm:multilang-python:jar:1.1.0:compile
[INFO] +- com.my.storm:my-common:jar:1.1:compile
[INFO] +- commons-logging:commons-logging:jar:1.1.3:compile
[INFO] +- com.my.storm:mytopology-preprocessing:jar:1.1:compile
[INFO] |  \- org.apache.commons:commons-lang3:jar:3.7:compile
[INFO] +- org.apache.storm:storm-core:jar:1.1.0:compile
[INFO] |  +- com.esotericsoftware:kryo:jar:3.0.3:compile
[INFO] |  |  +- com.esotericsoftware:reflectasm:jar:1.10.1:compile
[INFO] |  |  |  \- org.ow2.asm:asm:jar:5.0.3:compile
[INFO] |  |  +- com.esotericsoftware:minlog:jar:1.3.0:compile
[INFO] |  |  \- org.objenesis:objenesis:jar:2.1:compile
[INFO] |  +- org.clojure:clojure:jar:1.7.0:compile
[INFO] |  +- ring-cors:ring-cors:jar:0.1.5:compile
[INFO] |  +- com.lmax:disruptor:jar:3.3.2:compile
[INFO] |  +- org.apache.logging.log4j:log4j-api:jar:2.8:compile
[INFO] |  +- org.apache.logging.log4j:log4j-core:jar:2.8:compile
[INFO] |  +- org.apache.logging.log4j:log4j-slf4j-impl:jar:2.8:compile
[INFO] |  +- org.slf4j:log4j-over-slf4j:jar:1.6.6:compile
[INFO] |  +- javax.servlet:servlet-api:jar:2.5:compile
[INFO] |  \- org.slf4j:slf4j-api:jar:1.7.21:compile
[INFO] +- org.apache.storm:storm-kafka-client:jar:1.1.0:compile
[INFO] +- org.apache.kafka:kafka_2.10:jar:0.10.2.0:compile
[INFO] |  +- net.sf.jopt-simple:jopt-simple:jar:5.0.3:compile
[INFO] |  +- com.yammer.metrics:metrics-core:jar:2.2.0:compile
[INFO] |  +- org.scala-lang:scala-library:jar:2.10.6:compile
[INFO] |  \- com.101tec:zkclient:jar:0.10:compile
[INFO] +- org.apache.kafka:kafka-clients:jar:0.10.2.0:compile
[INFO] |  +- net.jpountz.lz4:lz4:jar:1.3.0:compile
[INFO] |  \- org.xerial.snappy:snappy-java:jar:1.1.2.6:compile
[INFO] +- junit:junit:jar:4.12:compile
[INFO] |  \- org.hamcrest:hamcrest-core:jar:1.3:compile
[INFO] +- joda-time:joda-time:jar:2.10:compile
[INFO] +- com.googlecode.json-simple:json-simple:jar:1.1.1:compile
[INFO] +- com.my.ignite:my-config-cache:jar:1.1:compile
[INFO] |  +- org.apache.ignite:ignite-core:jar:2.5.0:compile
[INFO] |  |  +- javax.cache:cache-api:jar:1.0.0:compile
[INFO] |  |  +- org.jetbrains:annotations:jar:13.0:compile
[INFO] |  |  \- org.gridgain:ignite-shmem:jar:1.0.0:compile
[INFO] |  +- org.apache.ignite:ignite-spring:jar:2.5.0:compile
[INFO] |  |  +- org.apache.ignite:ignite-indexing:jar:2.5.0:compile
[INFO] |  |  |  +- org.apache.lucene:lucene-core:jar:5.5.2:compile
[INFO] |  |  |  +- org.apache.lucene:lucene-analyzers-common:jar:5.5.2:compile
[INFO] |  |  |  +- org.apache.lucene:lucene-queryparser:jar:5.5.2:compile
[INFO] |  |  |  |  +- org.apache.lucene:lucene-queries:jar:5.5.2:compile
[INFO] |  |  |  |  \- org.apache.lucene:lucene-sandbox:jar:5.5.2:compile
[INFO] |  |  |  \- com.h2database:h2:jar:1.4.195:compile
[INFO] |  |  +- org.springframework:spring-core:jar:4.3.7.RELEASE:compile
[INFO] |  |  +- org.springframework:spring-aop:jar:4.3.7.RELEASE:compile
[INFO] |  |  +- org.springframework:spring-beans:jar:4.3.7.RELEASE:compile
[INFO] |  |  +- org.springframework:spring-context:jar:4.3.7.RELEASE:compile
[INFO] |  |  +- org.springframework:spring-expression:jar:4.3.7.RELEASE:compile
[INFO] |  |  +- org.springframework:spring-tx:jar:4.3.7.RELEASE:compile
[INFO] |  |  \- org.springframework:spring-jdbc:jar:4.3.7.RELEASE:compile
[INFO] |  +- org.apache.ignite:ignite-log4j:jar:2.5.0:compile
[INFO] |  |  \- log4j:log4j:jar:1.2.17:compile
[INFO] |  \- postgresql:postgresql:jar:9.1-901.jdbc4:compile
[INFO] +- com.my.elastic:my-elasticsearch:jar:1.1:compile
[INFO] |  +- org.elasticsearch:elasticsearch-storm:jar:5.4.1:compile
[INFO] |  +- org.codehaus.jackson:jackson-core-asl:jar:1.9.13:compile
[INFO] |  +- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.13:compile
[INFO] |  \- commons-httpclient:commons-httpclient:jar:3.1:compile
[INFO] |     \- commons-codec:commons-codec:jar:1.2:compile
[INFO] \- com.google.code.gson:gson:jar:2.8.0:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.351 s
[INFO] Finished at: 2018-08-14T13:37:44+03:00
[INFO] Final Memory: 16M/294M
</p>

这是我的配置缓存的依赖树

apache ignite cache module dependency tree
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building my-config-cache 1.1
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ my-config-cache ---
[INFO] com.my.ignite:my-config-cache:jar:1.1
[INFO] +- org.apache.ignite:ignite-core:jar:2.5.0:compile
[INFO] |  +- javax.cache:cache-api:jar:1.0.0:compile
[INFO] |  +- org.jetbrains:annotations:jar:13.0:compile
[INFO] |  \- org.gridgain:ignite-shmem:jar:1.0.0:compile
[INFO] +- org.apache.ignite:ignite-spring:jar:2.5.0:compile
[INFO] |  +- org.apache.ignite:ignite-indexing:jar:2.5.0:compile
[INFO] |  |  +- commons-codec:commons-codec:jar:1.11:compile
[INFO] |  |  +- org.apache.lucene:lucene-core:jar:5.5.2:compile
[INFO] |  |  +- org.apache.lucene:lucene-analyzers-common:jar:5.5.2:compile
[INFO] |  |  +- org.apache.lucene:lucene-queryparser:jar:5.5.2:compile
[INFO] |  |  |  +- org.apache.lucene:lucene-queries:jar:5.5.2:compile
[INFO] |  |  |  \- org.apache.lucene:lucene-sandbox:jar:5.5.2:compile
[INFO] |  |  \- com.h2database:h2:jar:1.4.195:compile
[INFO] |  +- org.springframework:spring-core:jar:4.3.7.RELEASE:compile
[INFO] |  +- org.springframework:spring-aop:jar:4.3.7.RELEASE:compile
[INFO] |  +- org.springframework:spring-beans:jar:4.3.7.RELEASE:compile
[INFO] |  +- org.springframework:spring-context:jar:4.3.7.RELEASE:compile
[INFO] |  +- org.springframework:spring-expression:jar:4.3.7.RELEASE:compile
[INFO] |  +- org.springframework:spring-tx:jar:4.3.7.RELEASE:compile
[INFO] |  \- org.springframework:spring-jdbc:jar:4.3.7.RELEASE:compile
[INFO] +- org.apache.ignite:ignite-log4j:jar:2.5.0:compile
[INFO] |  \- log4j:log4j:jar:1.2.17:compile
[INFO] +- commons-logging:commons-logging:jar:1.1.3:compile
[INFO] +- com.google.code.gson:gson:jar:2.8.0:compile
[INFO] +- junit:junit:jar:4.12:compile
[INFO] |  \- org.hamcrest:hamcrest-core:jar:1.3:compile
[INFO] +- postgresql:postgresql:jar:9.1-901.jdbc4:compile
[INFO] \- com.googlecode.json-simple:json-simple:jar:1.1.1:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.070 s
[INFO] Finished at: 2018-08-14T13:40:24+03:00
[INFO] Final Memory:

尽管存在这些依赖关系,但在ide上运行拓扑和myconfigcache模块时,我收到了另一个严重警告

Strom topoloji module runtime

log4j:WARN No appenders could be found for logger (org.elasticsearch.storm.EsBolt).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

bla blaa blaa
........
...........

Aug 14, 2018 1:36:17 PM java.util.logging.LogManager$RootLogger log
SEVERE: Failed to resolve default logging config file: config/java.util.logging.properties
[13:36:17]    __________  ________________ 
[13:36:17]   /  _/ ___/ |/ /  _/_  __/ __/ 
[13:36:17]  _/ // (7 7    // /  / / / _/   
[13:36:17] /___/\___/_/|_/___/ /_/ /___/  
[13:36:17] 
[13:36:17] ver. 2.5.0#20180523-sha1:86e110c7

blaaa blaa

那么,除了storm log4j依赖项之外,我如何处理运行拓扑?

6yjfywim

6yjfywim1#

storm使用log4j 2进行日志记录,因此如果您想连接到该日志,则应该改用ignite-log4j2,ignite-log4j看起来像是针对log4j 1的。我也希望你能使用ignite-slf4j并完成这项工作。

相关问题