title: Task fails in Spark with ClassNotFoundException
body: <p>I am trying to write a simple java program which will read data from Cassandra via Spark. I am doing this at POC level. My code looks like this</p>
  
  <pre><code>String keyspace = "newkspace1";
  String tablename = "newtable5";
  public static void main(String[] args) 
      {
          SparkConf conf = new SparkConf();
          conf.setAppName("Cassandra Demo");
          conf.setMaster("spark://ct-0094:7077");
          conf.set("spark.cassandra.connection.host", "192.168.50.124");
          conf.set("spark.cassandra.connection.native.port", "9041");
          conf.set("spark.cassandra.connection.rpc.port", "9160");
          PerformerClass app = new PerformerClass(conf);
          app.run();
      } 
  private void run() 
      {
          JavaSparkContext sc = new JavaSparkContext(conf);
          showResults(sc);
          sc.stop();
      }
   private void showResults(JavaSparkContext sc) 
      {
          CassandraJavaPairRDD&lt;Integer, Integer&gt; rdd1 = javaFunctions(sc)
                  .cassandraTable(keyspace, tablename, mapColumnTo(Integer.class), mapColumnTo(Integer.class))
                  .select("keyval", "rangefield");
  
  
          List&lt;Integer&gt; lst = rdd1.keys().toArray();
          for(Integer l : lst)
          {
              System.out.println(l);
          }
      }
  </code></pre>
  
  <p>When I ran the above code, I got the following exceptions (Stack trace pasted below)</p>
  
  <blockquote>
    <p>15/01/15 19:22:41 WARN scheduler.TaskSetManager: Lost task 1.0 in stage 0.0 (TID 1, ct-0094): java.lang.ClassNotFoundException: com.datastax.spark.connector.rdd.partitioner.CassandraPartition
        at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:340)
        at org.apache.spark.serializer.JavaDeserializationStream$$anon$1.resolveClass(JavaSerializer.scala:59)
        [...]</p>
  </blockquote>
  
  <p>What am I missing?</p>