title: com.google.common.util.concurrent.ExecutionError: java.lang.NoClassDefFoundError: Could not initialize class com.datastax.driver.core.Cluster
body: <p>I am getting the below error while trying to insert some data into a Cassandra table from Spark.</p>
  
  <pre><code>com.google.common.util.concurrent.ExecutionError: java.lang.NoClassDefFoundError: Could not initialize class com.datastax.driver.core.Cluster
          at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2261)
          at com.google.common.cache.LocalCache.get(LocalCache.java:4000)
          at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4004)
          at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4874)
          at com.github.adejanovski.cassandra.jdbc.CassandraDriver.connect(CassandraDriver.java:102)
          at org.apache.spark.sql.execution.datasources.jdbc.DriverWrapper.connect(DriverWrapper.scala:45)
          at org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$$anonfun$createConnectionFactory$1.apply(JdbcUtils.scala:59)
          at org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$$anonfun$createConnectionFactory$1.apply(JdbcUtils.scala:50)
          at org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$.savePartition(JdbcUtils.scala:538)
          at org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$$anonfun$saveTable$1.apply(JdbcUtils.scala:670)
          at org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$$anonfun$saveTable$1.apply(JdbcUtils.scala:670)
          at org.apache.spark.rdd.RDD$$anonfun$foreachPartition$1$$anonfun$apply$29.apply(RDD.scala:925)
          at org.apache.spark.rdd.RDD$$anonfun$foreachPartition$1$$anonfun$apply$29.apply(RDD.scala:925)
          at org.apache.spark.SparkContext$$anonfun$runJob$5.apply(SparkContext.scala:1944)
          at org.apache.spark.SparkContext$$anonfun$runJob$5.apply(SparkContext.scala:1944)
          at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:87)
          at org.apache.spark.scheduler.Task.run(Task.scala:99)
          at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:282)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
          at java.lang.Thread.run(Thread.java:745)
  Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.datastax.driver.core.Cluster
          at com.github.adejanovski.cassandra.jdbc.SessionHolder.createSession(SessionHolder.java:137)
          at com.github.adejanovski.cassandra.jdbc.SessionHolder.&lt;init&gt;(SessionHolder.java:83)
          at com.github.adejanovski.cassandra.jdbc.CassandraDriver$1.load(CassandraDriver.java:68)
          at com.github.adejanovski.cassandra.jdbc.CassandraDriver$1.load(CassandraDriver.java:65)
          at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3599)
          at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2379)
          at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2342)
          at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2257)
          ... 20 more
  </code></pre>
  
  <p>I am able to succesully execute the code first time, but when I execute the same code again, I am getting the aforementioned error. </p>