Spark job fails because it can't find the hadoop core-site.xml
<p>I'm trying to run a spark job and I'm getting this error when I try to start the driver:</p>

<pre><code>16/05/17 14:21:42 ERROR SparkContext: Error initializing SparkContext.
java.io.FileNotFoundException: Added file file:/var/lib/mesos/slave/slaves/0c080f97-9ef5-48a6-9e11-cf556dfab9e3-S1/frameworks/5c37bb33-20a8-4c64-8371-416312d810da-0002/executors/driver-20160517142123-0183/runs/802614c4-636c-4873-9379-b0046c44363d/core-site.xml does not exist.
    at org.apache.spark.SparkContext.addFile(SparkContext.scala:1364)
    at org.apache.spark.SparkContext.addFile(SparkContext.scala:1340)
    at org.apache.spark.SparkContext$$anonfun$15.apply(SparkContext.scala:491)
    at org.apache.spark.SparkContext$$anonfun$15.apply(SparkContext.scala:491)
    at scala.collection.immutable.List.foreach(List.scala:318)
    at org.apache.spark.SparkContext.&lt;init&gt;(SparkContext.scala:491)
    at org.apache.spark.api.java.JavaSparkContext.&lt;init&gt;(JavaSparkContext.scala:59)
    at com.spark.test.SparkJobRunner.main(SparkJobRunner.java:56)
    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$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:731)
    at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:181)
    at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:206)
    at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:121)
    at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
</code></pre>

<p>I have spark running on several servers that are a part of my mesos cluster (not sure that's right but that's what I'm doing) I also have hadoop running on these servers. I started the spark master on one server and then started the spark slaves on the other servers. I have 3 apps, not that it matters, but I have a UI, where the user can kick off spark jobs, it puts the jobs in a kafka queue, I have the a launcher app that creates the spark job using the SparkLauncher (see the code below) and then I have my spark driver which connects to the kafka queue and then processes requests sent in from the UI. The UI and launcher are running in marathon. Spark as stated above is it's own process on the cluster and the driver connects to spark to run the jobs.
EDIT: I have uploaded hdfs-site.xml, core-site.xml and spark-env.sh to hadoop and point to them in my spark context:</p>

<pre><code>SparkConf conf = new SparkConf()
                .setAppName(config.getString(SPARK_APP_NAME))
                .setMaster(sparkMaster)
                .setExecutorEnv("HADOOP_USER_NAME", config.getString(HADOOP_USER, ""))
                .set("spark.mesos.uris", "&lt;hadoop node&gt;:9000/config/core-site.xml,&lt;hadoop node&gt;:9000/config/hdfs-site.xml") 
                .set("spark.files", "core-site.xml,hdfs-site.xml,spark-env.sh") 
                .set("spark.mesos.coarse", "true")
                .set("spark.cores.max", config.getString(SPARK_CORES_MAX))
                .set("spark.driver.memory", config.getString(SPARK_DRIVER_MEMORY))
                .set("spark.driver.extraJavaOptions", config.getString(SPARK_DRIVER_EXTRA_JAVA_OPTIONS, ""))
                .set("spark.executor.memory", config.getString(SPARK_EXECUTOR_MEMORY))
                .set("spark.executor.extraJavaOptions", config.getString(SPARK_EXECUTOR_EXTRA_JAVA_OPTIONS))
                .set("spark.executor.uri", hadoopPath);
</code></pre>

<p>Here is the code that launches the driver:</p>

<pre><code>SparkLauncher launcher = new SparkLauncher()
            .setMaster(&lt;my spark/mesos master&gt;)
            .setDeployMode("cluster")
            .setSparkHome("/home/spark")
            .setAppResource(&lt;hdfs://path/to/a/spark.jar&gt;)
            .setMainClass(&lt;my main class&gt;);
handle = launcher.startApplication();
</code></pre>

<p>I'm sure I'm doing something wrong I just can't figure out what. I'm new to spark, hadoop and mesos, so feel free to point out anything else I'm doing wrong. </p>