0

I want to connect to Cassandra DB from SoapUI via JDBC step. And want to make different queries, using cql, as well. Note: I read through existed here answers on similar questions, but they did not help in result.

Pre-condition: Cassandra DB (Cassandra version 3.0.3), on server with IP smth like 10.x.x.x, port 9042

Done: I added following jars to <soapui>../bin/ext:

- cassandra-all-3.9
- cassandra-clientutil-3.9
- cassandra-jdbc-1.2.5
- cassandra-thrift-3.9
- libthrift-0.9.3
- slf4j-api-1.7.7
- thrift-0.6.1

In SoapUI, in configuration, I configured:

Driver : org.apache.cassandra.cql.jdbc.CassandraDriver
Connection String : jdbc:cassandra://10.x.x.x:9042/profilename

But trying to test connection - I receive just

java.sql.SQLNonTransientConnectionException: org.apache.thrift.transport.TTransportException: 
Read a negative frame size (-2080374784)

Question: how to fix this, to establish connection, and to make queries to DB?

randominstanceOfLivingThing
  • 16,873
  • 13
  • 49
  • 72
Dmitry
  • 664
  • 2
  • 16
  • 30

1 Answers1

2

You appear to be trying to connect the rpc (thrift) client to the native (CQL) port.

By default, 9042 should be the native port and 9160 the rpc port. These may have been changed: look in the server's cassandra.yaml and find what has been configured for native_transport_port and/or rpc_port.

Bear in mind that thrift/rpc has been deprecated since Cassandra 2.x and you should be using CQL where possible.

OrangeDog
  • 36,653
  • 12
  • 122
  • 207
  • Thanks, will do. Besides, checked from DataStax - works ok (queries, etc); in DataStax connection added via 9042 – Dmitry Oct 11 '16 at 12:49
  • If this JDBC driver uses thrift instead, then you need to use port 9160. – OrangeDog Oct 11 '16 at 12:55
  • Checked in yaml, on server (I have no rights to change there anything, so just info): native_transport_port: 9042; rpc_port: 9160; //////continue researching, thanks for initial advices. – Dmitry Oct 11 '16 at 12:57
  • So did you switch you connection string to 9160 or not? – OrangeDog Oct 11 '16 at 13:02
  • yes, I changed, and seems connection established. But no results on same cql query(via SoapUI), which successfully returns results in DataStax. – Dmitry Oct 11 '16 at 13:03
  • seems I have next error: "could not init org.apache.casssandra.cql.jdbc.ColumnDecoder". Googling jar for that... – Dmitry Oct 11 '16 at 13:05
  • Well you can't run CQL over a thrift connection. – OrangeDog Oct 11 '16 at 13:06