gpt4 book ai didi

java - Cassandra Java 连接问题

转载 作者:太空宇宙 更新时间:2023-11-04 11:38:12 24 4
gpt4 key购买 nike

我正在尝试使用 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();

感谢您的指导。

最佳答案

您的类路径中必须有一个早于 16.0.1 的 Guava 版本。 java驱动仅支持Guava 16.0.1至19(即将发布的3.2.0将支持16.0.1至21)。

检查您的类路径中是否有旧版本的 Guava ,并将其替换为 16.0.1 和 19.0 之间的版本。您的应用程序的类路径中也可能有多个 Guava jar ,在这种情况下,您应该删除旧的。

关于java - Cassandra Java 连接问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43057636/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com