Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9046927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T11:46:33+00:00 2026-06-16T11:46:33+00:00

I have an exception occurred, using cassandra with thrift. I want to insert some

  • 0

I have an exception occurred, using cassandra with thrift. I want to insert some data. Here is the java code:

package pacan.java.eee;
import java.nio.ByteBuffer;
import org.apache.cassandra.thrift.Cassandra;
import org.apache.cassandra.thrift.Column;
import org.apache.cassandra.thrift.ColumnParent;
import org.apache.cassandra.thrift.ConsistencyLevel;
import org.apache.cassandra.thrift.InvalidRequestException;
import org.apache.cassandra.thrift.NotFoundException;
import org.apache.cassandra.thrift.TBinaryProtocol;
import org.apache.cassandra.thrift.TimedOutException;
import org.apache.cassandra.thrift.UnavailableException;
import org.apache.thrift.TException;
import org.apache.thrift.protocol.TProtocol;
import org.apache.thrift.transport.TFramedTransport;
import org.apache.thrift.transport.TSocket;
import org.apache.thrift.transport.TTransport;

public class Main {

    private static final String UTF8 = "UTF8";

    /**
     * @param args
     * @throws TException 
     * @throws InvalidRequestException 
     * @throws NotFoundException 
     * @throws TimedOutException 
     * @throws UnavailableException 
     */
    public static void main(String[] args) throws InvalidRequestException, TException, NotFoundException, UnavailableException, TimedOutException {
        TTransport tr = new TFramedTransport(new TSocket("localhost", 7199));
        TProtocol protocol = new TBinaryProtocol(tr);
        Cassandra.Client client = new Cassandra.Client(protocol);
        tr.open();
        client.set_keyspace("keyspace");
        ColumnParent colParent = new ColumnParent("User");
        ByteBuffer rowid = ByteBuffer.wrap("100".getBytes());
        Column column = new Column();
        column.setName("description".getBytes());
        column.setValue("some value".getBytes());
        column.setTimestamp(System.currentTimeMillis());
        client.insert(rowid, colParent, column, ConsistencyLevel.ONE);
        tr.flush();
        tr.close();
    }

}

And here is the exception I got:

Exception in thread "main" org.apache.thrift.transport.TTransportException
    at org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport.java:132)
    at org.apache.thrift.transport.TTransport.readAll(TTransport.java:84)
    at org.apache.thrift.transport.TFramedTransport.readFrame(TFramedTransport.java:129)
    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.readAll(TBinaryProtocol.java:378)
    at org.apache.thrift.protocol.TBinaryProtocol.readI32(TBinaryProtocol.java:297)
    at org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:204)
    at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:69)
    at org.apache.cassandra.thrift.Cassandra$Client.recv_set_keyspace(Cassandra.java:493)
    at org.apache.cassandra.thrift.Cassandra$Client.set_keyspace(Cassandra.java:480)
    at pacan.java.eee.Main.main(Main.java:37)

Help, please! =) I’ve already google it, and wasn’t able to find an answer.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T11:46:34+00:00Added an answer on June 16, 2026 at 11:46 am
    • Have you defined/created a keyspace with name “keyspace”?
    • Are you sure that you’re running thrift/rpc on port 7199 (default is 9160).
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application that executes some heavy processing in background using java thread
i have inherited some code form another developer who is using entityClient for a
I am using POCO classes with EF Code First. I have a class Ball
Like the title says, I have the following exception: Description: Event code: 3005 Event
I have some JSF-trouble using h:selectOneMenu with a list from my backend bean: My
I have the following code which I'm using to get the user to input
I have started using the UnityAutoMoqContainer Here is the Link and I have below
I have this error in eclipse helios: Exception occurred executing command line. Cannot run
I have an exception handler for the type SqlException and I'm looking at the
I have an exception being thrown from a C# method, that takes a generic

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.