1

Trying to print out a data row from cassandra table but get the following NoClassDefFoundError. Any ideas?

scala> val test_words_rdd = sc.cassandraTable("test", "words")    
test_words_rdd: com.datastax.spark.connector.rdd.CassandraTableScanRDD[com.datastax.spark.connector.CassandraRow] =     CassandraTableScanRDD[1] at RDD at CassandraRDD.scala:15

scala> test_words_rdd.first
java.lang.NoClassDefFoundError: Could not initialize class com.datastax.driver.core.CodecRegistry
    at com.datastax.driver.core.Configuration$Builder.build(Configuration.java:259)
    at com.datastax.driver.core.Cluster$Builder.getConfiguration(Cluster.java:1135)
    ...

Not too familiar with the environment, so not sure if it is an issue with a file/class not being imported, if its just not finding any data/connecting to cassandra correctly, etc.

timmyg13
  • 503
  • 1
  • 5
  • 15
  • 1
    Have you added the Cassandra connector in SBT `libraryDependencies += "com.datastax.spark" %% "spark-cassandra-connector" % "1.5.0-M2"` – Ajay Gupta Oct 09 '15 at 15:10
  • @imagin I am not sure where to put this? I have been following this tutorial: http://christopher-batey.blogspot.com/2015/01/spark-cassandra-basics-connecting-to.html – timmyg13 Oct 13 '15 at 15:13
  • Check this question as they are working on Spark and Cassandra together.[This question](http://stackoverflow.com/questions/25837436/how-to-load-spark-cassandra-connector-in-the-shell) will surely help. Let me know if its not working. Will resolve it. – Ajay Gupta Oct 13 '15 at 17:30

0 Answers0