2017-03-27 170 views
1

我試圖使用Java程序連接到卡桑德拉集羣,但我得到下面的錯誤 -卡桑德拉Java連接問題

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

您的classpath中必須有一個比16.0.1更早的Guava版本。 java驅動程序僅支持Guava 16.0.1到19(即將發佈的3.2.0將支持16.0.1到21)。

檢查您的classpath是否有舊版本的guava,並將其替換爲16.0.1和19.0之間的版本。您的應用程序也可能在您的類路徑中包含多個番石榴罐,在這種情況下,您應該刪除較舊的那個。

+1

謝謝安迪。其實我的番石榴-14.0.1和番石榴-19.0都不兼容。從classpath刪除舊版本的工作。非常感謝。 –