使用java客户端创建Cassandra Cluster对象时,我看到了以下异常。
val cluster = Cluster.builder().
withProtocolVersion(ProtocolVersion.V3).
addContactPoint("127.0.0.1").
build()
例外情况表示未找到com.google.common.util.concurrent.MoreExecutors.listeningDecorator
方法。但是库(guava)被添加到classPath。
[error] Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.util.concurrent.MoreExecutors.listeningDecorator(Ljava/util/concurrent/ExecutorService;)Lcom/google/common/util/concurrent/ListeningExecutorService;
[error] at com.datastax.driver.core.Cluster.makeExecutor(Cluster.java:1100)
[error] at com.datastax.driver.core.Cluster.access$700(Cluster.java:62)
[error] at com.datastax.driver.core.Cluster$Manager.<init>(Cluster.java:1160)
[error] at com.datastax.driver.core.Cluster$Manager.<init>(Cluster.java:1110)
[error] at com.datastax.driver.core.Cluster.<init>(Cluster.java:118)
[error] at com.datastax.driver.core.Cluster.<init>(Cluster.java:105)
[error] at com.datastax.driver.core.Cluster.buildFrom(Cluster.java:174)
[error] at com.datastax.driver.core.Cluster$Builder.build(Cluster.java:1075)
show fullClasspath - 包含guava
Attributed(/home/kiranraj/.ivy2/cache/com.google.guava/guava/bundles/guava-16.0.1.jar)
答案 0 :(得分:0)
将番石榴更新为最新版本。 您还可以检查是否与任何其他JAR冲突。