Getting java.lang.NoClassDefFoundError: kafka/serializer/StringDecoder Exception while streaming kafka from Spark streaming
<p>I am trying to read the kafka streaming data from spark streaming application; while in the process of reading data I am getting following exception:</p>

<p>16/12/24 11:09:05 INFO storage.BlockManagerMaster: Registered BlockManager</p>

<pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: kafka/serializer/StringDecoder
    at com.inndata.RSVPSDataStreaming.KafkaToSparkStreaming.main(KafkaToSparkStreaming.java:69)
    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)
Caused by: java.lang.ClassNotFoundException: kafka.serializer.StringDecoder
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 10 more
</code></pre>

<p>Here is my versions info:</p>

<p><strong>spark: 1.6.2</strong></p>

<p><strong>kafka: 0.8.2</strong></p>

<p>Here is pom.xml:</p>

<pre><code>&lt;!-- https://mvnrepository.com/artifact/org.apache.kafka/kafka_2.11 --&gt;
&lt;dependency&gt;
    &lt;groupId&gt;org.apache.kafka&lt;/groupId&gt;
    &lt;artifactId&gt;kafka_2.11&lt;/artifactId&gt;
    &lt;version&gt;0.8.2.1&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
            &lt;groupId&gt;org.apache.spark&lt;/groupId&gt;
            &lt;artifactId&gt;spark-streaming_2.11&lt;/artifactId&gt;
            &lt;version&gt;1.6.2&lt;/version&gt;
&lt;/dependency&gt;
&lt;!-- https://mvnrepository.com/artifact/org.apache.spark/spark-streaming-kafka-0-8_2.11 --&gt;
&lt;dependency&gt;
            &lt;groupId&gt;org.apache.spark&lt;/groupId&gt;
            &lt;artifactId&gt;spark-streaming-kafka-0-8_2.11&lt;/artifactId&gt;
            &lt;version&gt;2.0.0&lt;/version&gt;
&lt;/dependency&gt;
&lt;!-- https://mvnrepository.com/artifact/org.apache.kafka/kafka-clients --&gt;
&lt;dependency&gt;
    &lt;groupId&gt;org.apache.kafka&lt;/groupId&gt;
    &lt;artifactId&gt;kafka-clients&lt;/artifactId&gt;
    &lt;version&gt;0.8.2.1&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
    &lt;groupId&gt;org.apache.spark&lt;/groupId&gt;
    &lt;artifactId&gt;spark-streaming-kafka-0-8-assembly_2.10&lt;/artifactId&gt;
    &lt;version&gt;2.0.0-preview&lt;/version&gt;
&lt;/dependency&gt;
</code></pre>