首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Cassandra- Pelops :在尝试将数据插入cassandra时没有获得这样的方法错误

Cassandra- Pelops :在尝试将数据插入cassandra时没有获得这样的方法错误
EN

Stack Overflow用户
提问于 2011-12-06 15:41:22
回答 1查看 1.4K关注 0票数 1

当我试图使用pelops将数据插入cassandra时,我得到了以下错误

代码语言:javascript
复制
 java.lang.NoSuchMethodError: org.apache.cassandra.thrift.Column.<init>(Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;J)V

我用的是下面的罐子

  1. scale7-core-1.3.0.jar
  2. scale7-pelops-0.912-0.7.0-rc4-1.jar
  3. All cassandra-1.0.5

库目录中的jars

调用以下函数将导致异常

代码语言:javascript
复制
public void writeToBatch(String columnFamily, String rowKey, String colmName,String value, int ttl)
 {
     this.mutator.writeColumn(columnFamily, rowKey,
                mutator.newColumn(colmName, value, ttl));
 }

错误堆栈如下:

代码语言:javascript
复制
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.cassandra.thrift.Column.<init>(Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;J)V
    at org.scale7.cassandra.pelops.Mutator.newColumn(Mutator.java:625)
    at org.scale7.cassandra.pelops.Mutator.newColumn(Mutator.java:562)
    at com.audienceadnetwork.cassandra.sstablewriter.utils.PelopsClient.writeToBatch(Unknown Source)
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-12-06 16:23:01

您正在将针对cassandra-1.0.5构建的节俭绑定与针对更老的节俭绑定的pelops版本混合。api本身是向后兼容的,但不能混合这样的绑定。你有两个选择:

最好的选择可能是升级到更新版本的pelops。根据其github:https://github.com/s7/scale7-pelops,1.0.x版本有可用的快照版本。

如果出于某种原因,您需要使用上面使用的pelops版本,那么您还需要使用版本所依赖的cassandra节俭绑定,而不是构建在cassandra 1.0.5上的绑定。

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8402604

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档