Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cassandra Read a negative frame size

I'm experiencing this error while trying to query Cassandra using cassandra-jdbc(1.1.3) driver.

Caused by: org.apache.thrift.transport.TTransportException: Read a negative frame size (-2147418110)!
at org.apache.thrift.transport.TFramedTransport.readFrame(TFramedTransport.java:133)
at org.apache.thrift.transport.TFramedTransport.read(TFramedTransport.java:101)
at org.apache.thrift.transport.TTransport.readAll(TTransport.java:84)
at org.apache.thrift.protocol.TBinaryProtocol.readStringBody(TBinaryProtocol.java:354)
at org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:215)
at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:69)
at org.apache.cassandra.thrift.Cassandra$Client.recv_prepare_cql_query(Cassandra.java:1438)
at org.apache.cassandra.thrift.Cassandra$Client.prepare_cql_query(Cassandra.java:1424)
at org.apache.cassandra.cql.jdbc.CassandraConnection.prepare(CassandraConnection.java:438)
at org.apache.cassandra.cql.jdbc.CassandraConnection.prepare(CassandraConnection.java:452)
at org.apache.cassandra.cql.jdbc.CassandraPreparedStatement.<init>(CassandraPreparedStatement.java:85)
... 79 more

This is my sample code snippet

statement = connection.prepareStatement(SELECT_CQL);
statement.setString(1, ID);
resultSet = statement.executeQuery();
like image 514
udarakr Avatar asked Apr 23 '14 15:04

udarakr


1 Answers

I'm supposing you were trying to connect to Cassandra via JDBC on cql port (9042). I was able to connect to it enabling thrift with

nodetool enablethrift

and then connecting to port 9160 (or whichever you might have overriden in conf/cassandra.yaml). Hope this helps.

like image 100
Perry Cox Avatar answered Sep 29 '22 12:09

Perry Cox