Caused by: java.lang.NoClassDefFoundError: com/google/common/util/concurrent/FutureFallback
at com.datastax.driver.core.GuavaCompatibility.selectImplementation(GuavaCompatibility.java:136) ~[cassandra-driver-core-3.4.0.jar:?]
at com.datastax.driver.core.GuavaCompatibility.<clinit>(GuavaCompatibility.java:52) ~[cassandra-driver-core-3.4.0.jar:?]
at com.datastax.driver.core.Cluster.<clinit>(Cluster.java:68) ~[cassandra-driver-core-3.4.0.jar:?]
at org.springframework.boot.autoconfigure.cassandra.CassandraAutoConfiguration.cassandraCluster(CassandraAutoConfiguration.java:67) ~[spring-boot-autoconfigure-2.0.3.RELEASE.jar:2.0.3.RELEASE]
at org.springframework.boot.autoconfigure.cassandra.CassandraAutoConfiguration$$EnhancerBySpringCGLIB$$2c22fb7a.CGLIB$cassandraCluster$0(<generated>) ~[spring-boot-autoconfigure-2.0.3.RELEASE.jar:2.0.3.RELEASE]
at org.springframework.boot.autoconfigure.cassandra.CassandraAutoConfiguration$$EnhancerBySpringCGLIB$$2c22fb7a$$FastClassBySpringCGLIB$$ee73f3df.invoke(<generated>) ~[spring-boot-autoconfigure-2.0.3.RELEASE.jar:2.0.3.RELEASE]
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) ~[spring-core-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:361) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.boot.autoconfigure.cassandra.CassandraAutoConfiguration$$EnhancerBySpringCGLIB$$2c22fb7a.cassandraCluster(<generated>) ~[spring-boot-autoconfigure-2.0.3.RELEASE.jar:2.0.3.RELEASE]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_91]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_91]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_91]
原因:项目中指定了guava版本为27,Cassandra驱动在判断guava>26版本时出现问题,有bug,最新版本已fix
解决方法:
1.修改Cassandra驱动版本,显示指定版本
2.重写Cassandra自带的判断guava版本的类:com.datastax.driver.core.GuavaCompatibility, 可参考最新的驱动中的写法
3.不在pom里面指定guava版本