title: Issue on using kryo serialization for spark
body: <p>I am transforming a existing package to make it run on spark, in order to serialize the class in the third-party tools, I used the following code:</p>
  
  <pre><code>SparkConf conf = new SparkConf().setAppName("my.app.spark").setMaster("local").set("spark.serializer", "org.apache.spark.serializer.KryoSerializer").set("spark.kryo.registrationRequired", "true");
  
  
  
              try {
                      conf.registerKryoClasses(new Class&lt;?&gt;[]{
                                      Class.forName("my.thirdparty.classes"),
                                      Class.forName("my.thirdparty.classes2")
                      });
              } catch (ClassNotFoundException e) {
                      // TODO Auto-generated catch block
                      e.printStackTrace();
              }
  
  
          JavaSparkContext context = new JavaSparkContext(conf);
          List&lt;File&gt; txtFiles = new ArrayList&lt;File&gt;();
              for(File file: input.listFiles(filter)) {
                      txtFiles.add(file);
              }
              JavaRDD&lt;File&gt; distText = context.parallelize(txtFiles);
              distText.foreach(
                              new VoidFunction&lt;File&gt;()
                                      { public void call(File file) {
                                              processFile(file);
  
        }});
              context.close();  
  </code></pre>
  
  <p>When I submit using the following command:
  spark-submit --class "mypackage.RunWithSpark" --master yarn --driver-memory 6g mypackage.jar</p>
  
  <p>I got the error like:</p>
  
  <pre><code>Exception in thread "main" java.lang.NoSuchMethodError: org.apache.spark.SparkConf.registerKryoClasses([Ljava/lang/Class;)Lorg/apache/spark/SparkConf;
          ...
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at org.apache.spark.deploy.SparkSubmit$.launch(SparkSubmit.scala:292)
          at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:55)
          at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
  </code></pre>
  
  <p>I am new to Spark, could you please help with it?</p>
  
  <p>Thanks </p>