Open LeoAugust19 opened 6 years ago
@izrik May I pull a request to fix this issue?
@mritunjaykumar Can you take a look at this?
Sorry.. I have been busy with some other issues. I will take a look and will ping you back. :-)
Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.io.Closeables.closeQuietly(Ljava/io/Closeable;)V at org.apache.curator.ConnectionState.close(ConnectionState.java:109) at org.apache.curator.CuratorZookeeperClient.close(CuratorZookeeperClient.java:201) at org.apache.curator.framework.imps.CuratorFrameworkImpl.close(CuratorFrameworkImpl.java:285) at com.rackspacecloud.blueflood.service.ZKShardLockManager.shutdownUnsafe(ZKShardLockManager.java:394)
Hi, @izrik there are multiple versions of com.google.guava:guava:jar in com.rackspacecloud:blueflood-core:jar:2.0.0-SNAPSHOT. As shown in the following dependency tree, only the newer version 19.0 will be loaded and the other versions will be shadowed, according to "Maven's nearest wins strategy", during the packaging process.
However, method <com.google.common.io.Closeables: void closeQuietly(java.io.Closeable)> is removed from > guava 16.x, therefore it can not be loaded via guava 19.0. As a result, when your project referencing the missing method, an exception will be thrown.
Dependency tree
com.rackspacecloud:blueflood-core:jar:2.0.0-SNAPSHOT +- com.netflix.astyanax:astyanax-core:jar:1.56.34:compile | +- (com.google.guava:guava:jar:14.0.1:compile - omitted for conflict with 19.0) | - org.codehaus.jackson:jackson-core-asl:jar:1.9.2:compile +- com.netflix.astyanax:astyanax-thrift:jar:1.56.34:compile | +- (joda-time:joda-time:jar:1.6.2:compile - omitted for duplicate) | +- (com.google.guava:guava:jar:14.0.1:compile - omitted for duplicate) | - (org.codehaus.jettison:jettison:jar:1.2:compile - omitted for duplicate) +- com.netflix.astyanax:astyanax-cassandra:jar:1.56.34:compile | +- (joda-time:joda-time:jar:1.6.2:compile - omitted for duplicate) | +- (com.google.guava:guava:jar:14.0.1:compile - omitted for duplicate) | +- org.apache.cassandra:cassandra-all:jar:1.2.2:compile | | +- (org.xerial.snappy:snappy-java:jar:1.0.4.1:compile - omitted for duplicate) | | +- net.jpountz.lz4:lz4:jar:1.1.0:compile | | +- com.ning:compress-lzf:jar:0.8.4:compile | | +- (com.google.guava:guava:jar:12.0:compile - omitted for conflict with 14.0.1) | | - com.github.stephenc:jamm:jar:0.2.5:compile | +- (com.netflix.astyanax:astyanax-core:jar:1.56.34:compile - omitted for duplicate) | - (org.codehaus.jettison:jettison:jar:1.2:compile - omitted for duplicate) +- com.netflix.astyanax:astyanax-recipes:jar:1.56.34:compile | +- (com.eaio.uuid:uuid:jar:3.2:compile - omitted for duplicate) | +- (com.google.guava:guava:jar:14.0.1:compile - omitted for duplicate) | - (org.codehaus.jettison:jettison:jar:1.2:compile - omitted for duplicate) +- com.datastax.cassandra:cassandra-driver-core:jar:3.0.3:compile | +- (com.google.guava:guava:jar:16.0.1:compile - omitted for conflict with 14.0.1) | - (io.dropwizard.metrics:metrics-core:jar:3.1.2:compile - omitted for duplicate) +- org.apache.curator:curator-framework:jar:2.3.0:compile | +- org.apache.curator:curator-client:jar:2.3.0:compile | | +- (org.slf4j:slf4j-api:jar:1.6.4:compile - omitted for duplicate) | | +- (org.apache.zookeeper:zookeeper:jar:3.4.5:compile - omitted for duplicate) | | - (com.google.guava:guava:jar:14.0.1:compile - omitted for duplicate) | +- org.apache.zookeeper:zookeeper:jar:3.4.5:compile | | +- (org.slf4j:slf4j-api:jar:1.6.1:compile - omitted for conflict with 1.6.4) | | +- (log4j:log4j:jar:1.2.15:compile - omitted for conflict with 1.2.16) | | - (jline:jline:jar:0.9.94:compile - omitted for conflict with 1.0) | - (com.google.guava:guava:jar:14.0.1:compile - omitted for duplicate) +- org.apache.curator:curator-recipes:jar:2.3.0:compile | +- (org.apache.curator:curator-framework:jar:2.3.0:compile - omitted for duplicate) | +- (org.apache.zookeeper:zookeeper:jar:3.4.5:compile - omitted for duplicate) | - (com.google.guava:guava:jar:14.0.1:compile - omitted for duplicate) +- com.google.guava:guava:jar:19.0:compile
Solution
Upgrade org.apache.curator:curator-framework:jar:2.3.0:compile and org.apache.curator:curator-recipes:jar:2.3.0:compile to 2.7.1.
Thanks. Regards, Leo