cqlsh uses thrift, the java driver uses the native protocol. Thirft is on port 9160 by default, the native protocol is on port 9042 by default. Try connecting on port 9042 with the driver instead (which is the driver default really).
-- Sylvain On Thu, Oct 31, 2013 at 6:01 PM, Les Hartzman <lhartz...@gmail.com> wrote: > I'm running Cassandra 2.0.1 on Ubuntu in a VirtualBox VM. I'm using the > Datastax Java driver, 1.0.4, and am trying to connect to 127.0.0.1, port > 9160. > > I'm getting the NoHostAvailable exception and on the TransportException it > states [127.0.0.1] Channel has been closed. > > The server is running. I can bring up cqlsh and select the keyspace and > query the table without any problem. It shows that it is connected to > localhost:9160. > > The cassandra.yaml file in /etc/cassandra has 'start_native_transport: > true'. > > I did notice on startup the message "JNA not found. Native methods will > be disabled". Not sure if this means anything or not. > > Ideas? > > Thanks. > > Les > > > >