当我试图使用pelops将数据插入cassandra时,我得到了以下错误
java.lang.NoSuchMethodError: org.apache.cassandra.thrift.Column.<init>(Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;J)V我用的是下面的罐子
库目录中的jars
调用以下函数将导致异常
public void writeToBatch(String columnFamily, String rowKey, String colmName,String value, int ttl)
{
this.mutator.writeColumn(columnFamily, rowKey,
mutator.newColumn(colmName, value, ttl));
}错误堆栈如下:
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)发布于 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上的绑定。
https://stackoverflow.com/questions/8402604
复制相似问题