title: Standalone spark cluster. Can't submit job programmatically -> java.io.InvalidClassException
body: <p>Spark fellows, I’m quite new to Spark, that’s why I hope for your help indeed. </p>
  
  <p>I’m trying to schedule the quite simple job on spark cluster from my laptop. Despite it works, when I submit it with <code>./spark-submit</code>, it throws an exception, when I try to do it programmatically. </p>
  
  <p>Environment: 
  - Spark - 1 master node and 2 worker nodes (standalone mode). Spark was not compiled, but the binaries were downloaded. Spark version - 1.0.2 
  - java version "1.7.0_45" 
  - Application jar is located everywhere (on client and on worker nodes in the same place); 
  - README.md file is copied to every node as well; </p>
  
  <p>The application I'm trying to run:</p>
  
  <pre><code>val logFile = "/user/vagrant/README.md"
  
  val conf = new SparkConf()
  conf.setMaster("spark://192.168.33.50:7077")
  conf.setAppName("Simple App")
  conf.setJars(List("file:///user/vagrant/spark-1.0.2-bin-hadoop1/bin/hello-apache-spark_2.10-1.0.0-SNAPSHOT.jar"))
  conf.setSparkHome("/user/vagrant/spark-1.0.2-bin-hadoop1")
  
  val sc = new SparkContext(conf)
  
  val logData = sc.textFile(logFile, 2).cache()
  </code></pre>
  
  <p>...</p>
  
  <p>So the problem is, that this application runs on cluster successfully, when I do: </p>
  
  <pre><code>./spark-submit --class com.paycasso.SimpleApp --master spark://192.168.33.50:7077 --deploy-mode client file:///home/vagrant/spark-1.0.2-bin-hadoop1/bin/hello-apache-spark_2.10-1.0.0-SNAPSHOT.jar
  </code></pre>
  
  <p>But it doesn't work, when I try to do the same programmatically by calling <code>sbt run</code> </p>
  
  <p>Here is the stacktrace, that I get on master node: </p>
  
  <pre><code>14/09/04 15:09:44 ERROR Remoting: org.apache.spark.deploy.ApplicationDescription; local class incompatible: stream classdesc serialVersionUID = -6451051318873184044, local class serialVersionUID = 583745679236071411
  java.io.InvalidClassException: org.apache.spark.deploy.ApplicationDescription; local class incompatible: stream classdesc serialVersionUID = -6451051318873184044, local class serialVersionUID = 583745679236071411
      at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:617)
      at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1622)
      at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1517)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1771)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1990)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1915)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
      at akka.serialization.JavaSerializer$$anonfun$1.apply(Serializer.scala:136)
      at scala.util.DynamicVariable.withValue(DynamicVariable.scala:57)
      at akka.serialization.JavaSerializer.fromBinary(Serializer.scala:136)
      at akka.serialization.Serialization$$anonfun$deserialize$1.apply(Serialization.scala:104)
      at scala.util.Try$.apply(Try.scala:161)
      at akka.serialization.Serialization.deserialize(Serialization.scala:98)
      at akka.remote.serialization.MessageContainerSerializer.fromBinary(MessageContainerSerializer.scala:58)
      at akka.serialization.Serialization$$anonfun$deserialize$1.apply(Serialization.scala:104)
      at scala.util.Try$.apply(Try.scala:161)
      at akka.serialization.Serialization.deserialize(Serialization.scala:98)
      at akka.remote.MessageSerializer$.deserialize(MessageSerializer.scala:23)
      at akka.remote.DefaultMessageDispatcher.payload$lzycompute$1(Endpoint.scala:55)
      at akka.remote.DefaultMessageDispatcher.payload$1(Endpoint.scala:55)
      at akka.remote.DefaultMessageDispatcher.dispatch(Endpoint.scala:73)
      at akka.remote.EndpointReader$$anonfun$receive$2.applyOrElse(Endpoint.scala:764)
      at akka.actor.ActorCell.receiveMessage(ActorCell.scala:498)
      at akka.actor.ActorCell.invoke(ActorCell.scala:456)
      at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:237)
      at akka.dispatch.Mailbox.run(Mailbox.scala:219)
      at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:386)
      at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
      at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
      at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
      at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
  </code></pre>
  
  <p>What could be the solution to this? 
  Thank you in advance.</p>