java.lang.ClassCastException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • It seems that internal authentication and authorization introduced in 1.2.2 is not yet supported in the Java driver. http://www.datastax.com/docs/1.2/security/native_authentication I tried to make use of the AuthInfoProvider to provide credentials for authenticating with Cassandra 1.2.4 cluster with valid credentials that has read & write permission on the given keyspace as follows: SimpleAuthProvider authProvider = new SimpleAuthProvider(); authProvider.add("user", "password"); Cluster cluster = Cluster.builder() .withAuthInfoProvider(authProvider) .... .build(); But when I execute the code to create this cluster, I get the following exception: java.lang.ClassCastException: org.apache.cassandra.transport.messages.AuthenticateMessage cannot be cast to org.apache.cassandra.transport.messages.ErrorMessage at com.datastax.driver.core.Connection.initializeTransport(Connection.java:157) at com.datastax.driver.core.Connection.<init>(Connection.java:118) at com.datastax.driver.core.Connection.<init>(Connection.java:90) at com.datastax.driver.core.Connection$Factory.open(Connection.java:376) at com.datastax.driver.core.ControlConnection.tryConnect(ControlConnection.java:203) at com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:166) at com.datastax.driver.core.ControlConnection.connect(ControlConnection.java:83) at com.datastax.driver.core.Cluster$Manager.<init>(Cluster.java:548) at com.datastax.driver.core.Cluster$Manager.<init>(Cluster.java:533) at com.datastax.driver.core.Cluster.<init>(Cluster.java:65) at com.datastax.driver.core.Cluster.buildFrom(Cluster.java:93) at com.datastax.driver.core.Cluster$Builder.build(Cluster.java:484)
    via by Tran Huynh,
  • It seems that internal authentication and authorization introduced in 1.2.2 is not yet supported in the Java driver. http://www.datastax.com/docs/1.2/security/native_authentication I tried to make use of the AuthInfoProvider to provide credentials for authenticating with Cassandra 1.2.4 cluster with valid credentials that has read & write permission on the given keyspace as follows: SimpleAuthProvider authProvider = new SimpleAuthProvider(); authProvider.add("user", "password"); Cluster cluster = Cluster.builder() .withAuthInfoProvider(authProvider) .... .build(); But when I execute the code to create this cluster, I get the following exception: java.lang.ClassCastException: org.apache.cassandra.transport.messages.AuthenticateMessage cannot be cast to org.apache.cassandra.transport.messages.ErrorMessage at com.datastax.driver.core.Connection.initializeTransport(Connection.java:157) at com.datastax.driver.core.Connection.<init>(Connection.java:118) at com.datastax.driver.core.Connection.<init>(Connection.java:90) at com.datastax.driver.core.Connection$Factory.open(Connection.java:376) at com.datastax.driver.core.ControlConnection.tryConnect(ControlConnection.java:203) at com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:166) at com.datastax.driver.core.ControlConnection.connect(ControlConnection.java:83) at com.datastax.driver.core.Cluster$Manager.<init>(Cluster.java:548) at com.datastax.driver.core.Cluster$Manager.<init>(Cluster.java:533) at com.datastax.driver.core.Cluster.<init>(Cluster.java:65) at com.datastax.driver.core.Cluster.buildFrom(Cluster.java:93) at com.datastax.driver.core.Cluster$Builder.build(Cluster.java:484)
    via by Tran Huynh,
    • java.lang.ClassCastException: org.apache.cassandra.transport.messages.AuthenticateMessage cannot be cast to org.apache.cassandra.transport.messages.ErrorMessage at com.datastax.driver.core.Connection.initializeTransport(Connection.java:157) at com.datastax.driver.core.Connection.<init>(Connection.java:118) at com.datastax.driver.core.Connection.<init>(Connection.java:90) at com.datastax.driver.core.Connection$Factory.open(Connection.java:376) at com.datastax.driver.core.ControlConnection.tryConnect(ControlConnection.java:203) at com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:166) at com.datastax.driver.core.ControlConnection.connect(ControlConnection.java:83) at com.datastax.driver.core.Cluster$Manager.<init>(Cluster.java:548) at com.datastax.driver.core.Cluster$Manager.<init>(Cluster.java:533) at com.datastax.driver.core.Cluster.<init>(Cluster.java:65) at com.datastax.driver.core.Cluster.buildFrom(Cluster.java:93) at com.datastax.driver.core.Cluster$Builder.build(Cluster.java:484)
    No Bugmate found.