2017-02-09 62 views

回答

0

ClassNotFoundException意味着这些类不是在类路径中,那么你应该加入这个依赖于你的pom.xml

<!-- https://mvnrepository.com/artifact/com.google.guava/guava --> 
<dependency> 
    <groupId>com.google.guava</groupId> 
    <artifactId>guava</artifactId> 
    <version>16.01</version> 
</dependency> 

如果你不使用Maven,只要进入这个link和下载JAR文件,并包含在Java类路径 取决于你是如何做的项目,这个版本的这种依赖性会改变,只是寻找一个兼容的版本为您的春季数据版本here

更新: 您应该使用guava 16.01 method,因为在guava 19 method方法不再有效的API说

@Deprecated 
@GwtIncompatible(value="TODO") 
public static ListeningExecutorService sameThreadExecutor() 
Deprecated. Use directExecutor() if you only require an Executor and newDirectExecutorService() if you need a ListeningExecutorService. 
This method will be removed in August 2016. 

根据编译依赖部分this,番石榴是16.01

+0

春数据卡桑德拉已经带来了番石榴19.0,但检查它的工作原理我已经添加了21.0 dep。这个dint解决了这个问题,它仍然给出了一个异常:java.lang.NoSuchMethodError:com.google.common.util.concurrent.MoreExecutors.sameThreadExecutor()Lcom/google/common/util/concurrent/ListeningExecutorService; \t at com.datastax.driver.core.PoolingOptions。看看我的更新,你应该使用番石榴16.01作为编译版本点,任何其他版本会给你冲突 –

+0

,以便作品? – Koitoer