简体   繁体   中英

Cassandra Java Connectivity issue

I am trying to connect to Cassandra Cluster using Java program but I get following error -

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)

I tried working with standalone java and it works fine, but throws error in my project. It throws exception at the following line :

this.cluster = Cluster.builder().addContactPoint(node).withPort(port).build();

Appreciate your guidance.

There must be a version of Guava in your classpath that is older than 16.0.1. The java driver only supports Guava 16.0.1 through 19 (3.2.0 which will be released soon will support 16.0.1 through 21).

Check your classpath for an older version of guava and replace it with a version between 16.0.1 and 19.0. It is also possible that your application has multiple guava jars in your classpath, in which case you should remove the older one(s).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM