Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

charumakhijani avatar image
charumakhijani asked ·

Getting ClassNotFound error for NoHostAvailableException with spark-cassandra-connector_2.12-3.0.0.jar

Recently I upgraded from Spark 2.1.0 to Spark 3.x.

With 2.1.0, I was using spark-cassandra-connector_2.11-2.4.1.jar and it had this exception- com.datastax.driver.core.exceptions.NoHostAvailableException

But when I am using spark-cassandra-connector_2.12-3.0.0.jar for Spark 3.x, NoHostAvailableException is not available in the jar.

Please let me know Is this exception removed from 2.12_3..0.0 jar? And is there any new class for same purpose?

Or is there any new dependency that I have to add now for this?

spark-cassandra-connector
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered ·

If you have a look at the Version Compatibility matrix on the Spark connector repository, you'll see that version 3.0.0 of the connector uses Java driver 4.7 (instead of 3.0).

Java driver 4 was completely refactored and is not binary compatible with previous versions of the driver so you will need to rewrite your code.

The equivalent exception is NoNodeAvailableException. See the Java driver API docs for a list of driver exceptions. Cheers!

Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.