incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "dong.yajun" <>
Subject Could not connect to cassandra 1.0.9
Date Thu, 21 Jun 2012 02:10:00 GMT
Hi list

I'd like to connect to remote Cassandra using Java client, the following
code I use, but ImcompatibleClassChangeError was occured, the source that
was just dependent on the following jars:

apache-cassandra-1.0.9.jar, apache-cassandra-clientutil-1.0.9.jar,

and the code:

import org.apache.cassandra.thrift.Cassandra;
import org.apache.cassandra.thrift.TBinaryProtocol;
import org.apache.thrift.protocol.TProtocol;
import org.apache.thrift.transport.TFramedTransport;
import org.apache.thrift.transport.TSocket;
import org.apache.thrift.transport.TTransport;
import org.apache.thrift.transport.TTransportException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class TestClient {
 private static final Logger logger =

private static Cassandra.Iface createConnection()
throws TTransportException {
if (System.getProperty("") == null
|| System.getProperty("cassandra.port") == null) {
logger.warn(" or cassandra.port is not defined, using
return createConnection("echadoop01", 9160, true);

private static Cassandra.Client createConnection(String host, Integer port,
boolean framed) throws TTransportException {
TSocket socket = new TSocket(host, port);
TTransport trans = framed ? new TFramedTransport(socket) : socket;;
TProtocol protocol = new TBinaryProtocol(trans);

return new Cassandra.Client(protocol);

public static void main(String args[]) throws TTransportException {
Cassandra.Iface client = createConnection();

and the exception:

Exception in thread "main" java.lang.IncompatibleClassChangeError:
Implementing class
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(
at java.lang.ClassLoader.defineClass(
at Method)
at java.lang.ClassLoader.loadClass(
at sun.misc.Launcher$AppClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
at com.newegg.cassandra.TestClient.createConnection(
at com.newegg.cassandra.TestClient.createConnection(
at com.newegg.cassandra.TestClient.main(

Does anyone have this kind of problem before? the above code could running
with Cassandra1.0.7.  Thank you in advance.


*Ric Dong *

View raw message