Jonathan, Thank you for your prompt response. I am now past this issue, and now facing this new issue
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.thrift.meta_data.FieldValueMetaData.<init>(BZ)V ________________________________ From: Jonathan Ellis <[email protected]> To: [email protected]; Krishnanand Khambadkone <[email protected]> Sent: Wednesday, August 29, 2012 12:40 PM Subject: Re: Exception when connecting to Cassandra There's an example of using Thrift with Java in http://wiki.apache.org/cassandra/ThriftExamples, but I'd recommend using a higher-level client from http://wiki.apache.org/cassandra/ClientOptions instead. On Wed, Aug 29, 2012 at 2:19 PM, Krishnanand Khambadkone <[email protected]> wrote: > Hi, I am using Cassandra V1.1.4 (apache-cassandra-1.1.4). I have a java > client that tries to connect to cassandra using this code snippet, > > public void prepopulate(String host,int port) throws Exception { > transport = new TFramedTransport(new TSocket(host, port)); > TProtocol protocol = new TBinaryProtocol(transport); // ( the >same class is in thrift and cassandra. I assume it should be the cassandra one >which you: TBinaryProtocol ) > Cassandra.Client client = new Cassandra.Client(protocol); > transport.open(); > insertAllHotels(); > > //also add all hotels to index to help searches > insertByCityIndexes(); > > //pre-populate the DB with POIs > insertAllPointsOfInterest(); > > } > > It is failing with this exception, > > Exception in thread "main" java.lang.IncompatibleClassChangeError: class > org.apache.cassandra.thrift.Cassandra$Client has interface > org.apache.thrift.TServiceClient as super class -- Jonathan Ellis Project Chair, Apache Cassandra co-founder of DataStax, the source for professional Cassandra support http://www.datastax.com
