Missing SLF4J logger on spark workers
<p>I am trying to run a job via <code>spark-submit</code>. </p>

<p>The error that results from this job is:</p>

<pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/Logger
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2625)
    at java.lang.Class.getMethod0(Class.java:2866)
    at java.lang.Class.getMethod(Class.java:1676)
    at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:494)
    at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:486)
Caused by: java.lang.ClassNotFoundException: org.slf4j.Logger
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    ... 6 more
</code></pre>

<p>Not sure if it matters, but I am trying to run this job within a Docker container on Mesos. Spark is 1.61, Mesos is 0.27.1, Python is 3.5, and Docker is 1.11.2. I am running in client mode.</p>

<p>Here is the gist of my <code>spark-submit</code> statement:</p>

<pre><code>export SPARK_PRINT_LAUNCH_COMMAND=true
./spark-submit \
    --master mesos://mesos-blahblahblah:port \
    --conf spark.mesos.executor.docker.image=docker-registry:spark-docker-image \
    --conf spark.mesos.executor.home=/usr/local/spark \
    --conf spark.executorEnv.MESOS_NATIVE_JAVA_LIBRARY=/usr/local/lib/libmesos.dylib \
    --conf spark.shuffle.service.enabled=true \
    --jars ~/spark/lib/slf4j-simple-1.7.21.jar \
    test.py
</code></pre>

<p>The gist of <code>test.py</code> is that it loads data from parquet, sorts it by a particular column, and then writes it back to parquet.</p>

<p>I added the <code>--jars</code> line when I kept getting that error (the error is not appearing in my driver - I navigate through the Mesos Framework to look at the stderr from each Mesos task to find it)</p>

<p>I also tried adding <code>--conf spark.executor.extraClassPath=http:some.ip:port/jars/slf4j-simple-1.7.21.jar</code>, </p>

<p>because I noticed when I ran the <code>spark-submit</code> from above it would output </p>

<p><code>INFO SparkContext: Added JAR file:~/spark/lib/slf4j-simple-1.7.21.jar at http://some.ip:port/jars/slf4j-simple-1.7.21.jar with timestamp 1472138630497</code></p>

<p>But the error is unchanged. Any ideas?</p>

<p>I found <a href="https://stackoverflow.com/questions/33832804/spark-1-5-2-and-slf4j-staticloggerbinder">this link</a>, which makes me think it is a bug. But the person hasn't posted any solution.</p>