0

使用这行代码创建集群很简单:

Cluster c = HFactory.getOrCreateCluster("MyTest Cluster","localhost:9160");

编译正常,运行时出现以下错误。感谢任何建议。

错误:[java] INFO 连接。CassandraHostRetryService:停机主机重试服务以队列大小 -1 开始,重试延迟 10 秒 [java] 线程“主”java.lang.NoClassDefFoundError 中的异常:org/apache/cassandra/thrift/InvalidRequestException [java ] 在 me.prettyprint.cassandra.connection.ConcurrentHClientPool.(ConcurrentHClientPool.java:48) [java] 在 me.prettyprint.cassandra.connection.RoundRobinBalancingPolicy.createConnection(RoundRobinBalancingPolicy.java:68) [java] 在 me.prettyprint.cassandra .connection.HConnectionManager.(HConnectionManager.java:65) [java] 在 me.prettyprint.cassandra.service.AbstractCluster.(AbstractCluster.java:69) [java] 在 me.prettyprint.cassandra.service.AbstractCluster.(AbstractCluster. java:65) [java] 在 me.prettyprint.cassandra。service.ThriftCluster.(ThriftCluster.java:17) [java] 在 me.prettyprint.hector.api.factory.HFactory.createCluster(HFactory.java:176) [java] 在 me.prettyprint.hector.api.factory.HFactory .getOrCreateCluster(HFactory.java:155) [java] 在 me.prettyprint.hector.api.factory.HFactory.getOrCreateCluster(HFactory.java:128)

4

1 回答 1

0

It's not finding thrift on your classpath. If you're using Maven and Eclipse, you might expect to see this if you didn't include the cassandra-thrift dependency, or if you performed a recent mvn eclipse:eclipse and need to "refresh" your project.

于 2012-04-27T06:32:09.657 回答