Cassandra Cluster initiation error with latest driver and server-2.1.13

354 views
Skip to first unread message

hemabs

unread,
Jun 3, 2018, 2:50:31 PM6/3/18
to DataStax Java Driver for Apache Cassandra User Mailing List
Hi All,

Im trying to upgrade cassandra-driver-core from 2.1.10.1 to 3.5.0. But the apache server version is at Cassandra 2.1.13.
Below piece of connecting snippet used to work on 2.1.10.1
cluster = Cluster.builder().addContactPoints("myhost").withPort(535).build();
                session = cluster.connect("mykeyspace");

But with 3.50 java driver, Im seeing below error:
java.lang.ExceptionInInitializerError
at com.datastax.driver.core.Cluster$Manager.init(Cluster.java:1476)
at com.datastax.driver.core.Cluster.init(Cluster.java:160)
at com.datastax.driver.core.Cluster.connectAsync(Cluster.java:342)
at com.datastax.driver.core.Cluster.connect(Cluster.java:292)
at .....my calling code origin......
Caused by: java.lang.ArrayIndexOutOfBoundsException: -17
at io.netty.util.collection.IntObjectHashMap.indexOf(IntObjectHashMap.java:294)
at io.netty.util.collection.IntObjectHashMap.get(IntObjectHashMap.java:99)
at com.datastax.driver.core.Metadata.indexByCaseInsensitiveHash(Metadata.java:343)
at com.datastax.driver.core.Metadata.<clinit>(Metadata.java:49)
... 36 more

Can someone let me know what am I doing wrong?
I can confirm that driver 3.5.0 does support server 2.1.13.

Appreciate the help.

Thanks
hbs

Andy Tolbert

unread,
Jun 4, 2018, 10:46:51 AM6/4/18
to DataStax Java Driver for Apache Cassandra User Mailing List
Hi Hemabs,

Can you confirm what version(s) of Netty jars are in your classpath?  Looking at the IntObjectHashMap code, it looks like it should protect negative index values from being used, but perhaps there is a bug in a particular version.

The driver works with all versions of C* 1.2+.

Thanks,
Andy

--
You received this message because you are subscribed to the Google Groups "DataStax Java Driver for Apache Cassandra User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java-driver-user+unsubscribe@lists.datastax.com.

hemabs

unread,
Jun 4, 2018, 2:59:37 PM6/4/18
to DataStax Java Driver for Apache Cassandra User Mailing List
Hi Andy,

I was able to resolve the error using netty4.0.56 in the classpath. Earlier I referred to 3.6.6. Thats the reason for failure.

Thanks
hbs
To unsubscribe from this group and stop receiving emails from it, send an email to java-driver-us...@lists.datastax.com.

Muqiao Yang

unread,
Jun 28, 2018, 10:08:14 PM6/28/18
to DataStax Java Driver for Apache Cassandra User Mailing List
Hi Hemabs,

May I ask how you changed the version of netty? Seems like it is implicitly depended on hadoop version.

Thanks,
Muqiao

hemabs於 2018年6月5日星期二 UTC+8上午2時59分37秒寫道:
Reply all
Reply to author
Forward
0 new messages