我正在尝试使用Java程序连接到Cassandra Cluster,但是我收到了以下错误 -
before connect[03/27/2017 14:11:23.836]{http-555-2
9280C0673CD218793ADD83C5} dd.sharelib.returninfo - Runtime:
java.lang.ExceptionInInitializerError
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:610)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:503)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalStateException: Detected Guava issue #1635 which indicates that a version of Guava less than 16.01 is in use. This introduces codec resolution issues and potentially other incompatibility issues in the driver. Please upgrade to Guava 16.01 or later.
at com.datastax.driver.core.SanityChecks.checkGuava(SanityChecks.java:62)
at com.datastax.driver.core.SanityChecks.check(SanityChecks.java:36)
at com.datastax.driver.core.Cluster.<clinit>(Cluster.java:68)
我尝试使用独立的java并且它工作正常,但在我的项目中抛出错误。它在以下行抛出异常:
this.cluster = Cluster.builder().addContactPoint(node).withPort(port).build();
感谢您的指导。
答案 0 :(得分:0)
类路径中必须存在一个早于16.0.1的Guava版本。 java驱动程序仅支持Guava 16.0.1到19(3.2.0将很快发布,将支持16.0.1到21)。
检查您的类路径以查找旧版本的guava,并将其替换为16.0.1和19.0之间的版本。您的应用程序也可能在您的类路径中有多个番石榴罐,在这种情况下您应该删除旧的番石榴罐。