java - duplicate guava.jar in classpath -
i use storm-0.10 put data hbase-1.0.1, , storm use guava-12.0 hbase use guava-18.0, both load classpath, leads job fail.
how ensure storm , hbase use correct version jar?
here pom.xml:
<dependencies> <dependency> <groupid>org.apache.hbase</groupid> <artifactid>hbase-client</artifactid> <version>1.0.0-cdh5.4.5</version> <exclusions> <exclusion> <groupid>com.google.guava</groupid> <artifactid>guava</artifactid> </exclusion> </exclusions> </dependency> <dependency> <groupid>org.apache.hadoop</groupid> <artifactid>hadoop-hdfs</artifactid> <version>2.3.0</version> </dependency> <dependency> <groupid>org.apache.hadoop</groupid> <artifactid>hadoop-common</artifactid> <version>2.3.0</version> </dependency> <dependency> <groupid>org.apache.hadoop</groupid> <artifactid>hadoop-client</artifactid> <version>2.3.0</version> </dependency> <dependency> <groupid>org.apache.storm</groupid> <artifactid>storm-core</artifactid> <version>0.10.0</version> </dependency> <dependency> <groupid>org.apache.storm</groupid> <artifactid>storm-kafka</artifactid> <version>0.10.0</version> </dependency> <dependency> <groupid>org.apache.kafka</groupid> <artifactid>kafka_2.10</artifactid> <version>0.8.2.1</version> <exclusions> <exclusion> <groupid>org.apache.zookeeper</groupid> <artifactid>zookeeper</artifactid> </exclusion> <exclusion> <groupid>log4j</groupid> <artifactid>log4j</artifactid> </exclusion> </exclusions> </dependency> <dependency> <groupid>org.json</groupid> <artifactid>org.json</artifactid> <version>2.0</version> </dependency> </dependencies>
and exception:
java.lang.illegalaccesserror: tried access method com.google.common.base.stopwatch.<init>()v class org.apache.hadoop.hbase.zookeeper.metatablelocator @ org.apache.hadoop.hbase.zookeeper.metatablelocator.blockuntilavailable(metatablelocator.java:434) ~[hbase-client-1.0.0-cdh5.6.0.jar:?] @ org.apache.hadoop.hbase.client.zookeeperregistry.getmetaregionlocation(zookeeperregistry.java:60) ~[hbase-client-1.0.0-cdh5.6.0.jar:?] @ org.apache.hadoop.hbase.client.connectionmanager$hconnectionimplementation.locateregion(connectionmanager.java:1122) ~[hbase-client-1.0.0-cdh5.6.0.jar:?] @ org.apache.hadoop.hbase.client.connectionmanager$hconnectionimplementation.locateregion(connectionmanager.java:1109) ~[hbase-client-1.0.0-cdh5.6.0.jar:?] @ org.apache.hadoop.hbase.client.connectionmanager$hconnectionimplementation.locateregioninmeta(connectionmanager.java:1261) ~[hbase-client-1.0.0-cdh5.6.0.jar:?] @ org.apache.hadoop.hbase.client.connectionmanager$hconnectionimplementation.locateregion(connectionmanager.java:1125) ~[hbase-client-1.0.0-cdh5.6.0.jar:?] @ org.apache.hadoop.hbase.client.asyncprocess.submit(asyncprocess.java:369) ~[hbase-client-1.0.0-cdh5.6.0.jar:?] @ org.apache.hadoop.hbase.client.asyncprocess.submit(asyncprocess.java:320) ~[hbase-client-1.0.0-cdh5.6.0.jar:?] @ org.apache.hadoop.hbase.client.bufferedmutatorimpl.backgroundflushcommits(bufferedmutatorimpl.java:206) ~[hbase-client-1.0.0-cdh5.6.0.jar:?] @ org.apache.hadoop.hbase.client.bufferedmutatorimpl.flush(bufferedmutatorimpl.java:183) ~[hbase-client-1.0.0-cdh5.6.0.jar:?] @ org.apache.hadoop.hbase.client.htable.flushcommits(htable.java:1513) ~[hbase-client-1.0.0-cdh5.6.0.jar:?] @ org.apache.hadoop.hbase.client.htable.put(htable.java:1107) ~[hbase-client-1.0.0-cdh5.6.0.jar:?] @ com.lujinhong.demo.storm.kinit.stormkinitdemo.hbasehelper.put(hbasehelper.java:182) ~[stormjar.jar:?] @ com.lujinhong.demo.storm.kinit.stormkinitdemo.hbasehelper.put(hbasehelper.java:175) ~[stormjar.jar:?] @ com.lujinhong.demo.storm.kinit.stormkinitdemo.prepaidfunction.execute(prepaidfunction.java:79) ~[stormjar.jar:?] @ storm.trident.planner.processor.eachprocessor.execute(eachprocessor.java:65) ~[storm-core-0.10.0.jar:0.10.0] @ storm.trident.planner.subtopologybolt$initialreceiver.receive(subtopologybolt.java:206) ~[storm-core-0.10.0.jar:0.10.0] @ storm.trident.planner.subtopologybolt.execute(subtopologybolt.java:146) ~[storm-core-0.10.0.jar:0.10.0] @ storm.trident.topology.tridentboltexecutor.execute(tridentboltexecutor.java:370) ~[storm-core-0.10.0.jar:0.10.0] @ backtype.storm.daemon.executor$fn__5694$tuple_action_fn__5696.invoke(executor.clj:690) ~[storm-core-0.10.0.jar:0.10.0] @ backtype.storm.daemon.executor$mk_task_receiver$fn__5615.invoke(executor.clj:436) ~[storm-core-0.10.0.jar:0.10.0] @ backtype.storm.disruptor$clojure_handler$reify__5189.onevent(disruptor.clj:58) ~[storm-core-0.10.0.jar:0.10.0] @ backtype.storm.utils.disruptorqueue.consumebatchtocursor(disruptorqueue.java:132) ~[storm-core-0.10.0.jar:0.10.0] @ backtype.storm.utils.disruptorqueue.consumebatchwhenavailable(disruptorqueue.java:106) ~[storm-core-0.10.0.jar:0.10.0] @ backtype.storm.disruptor$consume_batch_when_available.invoke(disruptor.clj:80) ~[storm-core-0.10.0.jar:0.10.0] @ backtype.storm.daemon.executor$fn__5694$fn__5707$fn__5758.invoke(executor.clj:819) ~[storm-core-0.10.0.jar:0.10.0] @ backtype.storm.util$async_loop$fn__545.invoke(util.clj:479) [storm-core-0.10.0.jar:0.10.0] @ clojure.lang.afn.run(afn.java:22) [clojure-1.6.0.jar:?] @ java.lang.thread.run(thread.java:745) [?:1.7.0_67]
if using maven:
<dependency> <groupid>sample.projecta</groupid> <artifactid>storm</artifactid> <version>1.0</version> <exclusions> <exclusion> <groupid>com.google.guava</groupid> <artifactid>guava</artifactid> </exclusion> </exclusions> </dependency>
for gradle:
compile("sample.projecta:staorm:1.0") { exclude group: 'com.google.guava' module: 'guava' }
Comments
Post a Comment