title: Unable to connect cassandra through R
body: <p>I am trying to follow an example given on "<a href="http://www.datastax.com/dev/blog/big-analytics-with-r-cassandra-and-hive" rel="nofollow">http://www.datastax.com/dev/blog/big-analytics-with-r-cassandra-and-hive</a>" to connect R with Cassandra. Following is my code:</p>
  
  <pre><code>library(RJDBC)
  
      #Load in the Cassandra-JDBC diver
      cassdrv &lt;- JDBC("org.apache.cassandra.cql.jdbc.CassandraDriver", list.files("D:/cassandra/lib",pattern="jar$",full.names=T))
  
      #Connect to Cassandra node and Keyspace
      casscon &lt;- dbConnect(cassdrv, "jdbc:cassandra://127.0.0.1:9042/demodb")
  </code></pre>
  
  <p>When I run above code in R, I get following error:</p>
  
  <pre><code>Error in .jcall(drv@jdrv, "Ljava/sql/Connection;", "connect", as.character(url)[1],  : 
    java.sql.SQLNonTransientConnectionException: org.apache.thrift.transport.TTransportException: Read a negative frame size (-2113929216)!
  </code></pre>
  
  <p>On the Cassandra server window get the following error for the above code:</p>
  
  <pre><code>ERROR 14:41:26,671 Unexpected exception during request
  java.lang.ArrayIndexOutOfBoundsException: 34
          at org.apache.cassandra.transport.Message$Type.fromOpcode(Message.java:1
  06)
          at org.apache.cassandra.transport.Frame$Decoder.decode(Frame.java:168)
          at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDeco
  der.java:425)
          at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(Fram
  eDecoder.java:303)
          at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:26
  8)
          at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:25
  5)
          at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88)
          at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(Abstract
  NioWorker.java:109)
          at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNi
  oSelector.java:312)
          at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioW
  orker.java:90)
          at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
          at java.lang.Thread.run(Unknown Source)
  </code></pre>
  
  <p>I tried to change port from 9042 to 9160 then request won't reach server in that case.
  I also tried to increase the size of <code>thrift_framed_transport_size_in_mb</code> from 15 to 500 but the error is same.</p>
  
  <p>The Cassandra is otherwise running fine and database is connected/updated easily through "devcenter".</p>
  
  <pre><code>R version: R-3.1.0,
  Cassandra version: 2.0.8,
  Operating System: Windows,
  XP Firewall: off
  </code></pre>