title: java.lang.NoClassDefFoundError: scala/collection/GenTraversableOnce
body: <p>I am trying to run spark streaming using Kafka. I am using Scala version 2.11.8 and Spark 2.1.0 build on scala 2.11.8. I understand that the issue is with scala version mismatch but all the dependencies are added with the correct versions(pic attached) and still I am getting this error.</p>
  
  <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: scala/collection/GenTraversableOnce$class
      at kafka.utils.Pool.&lt;init&gt;(Unknown Source)
      at kafka.consumer.FetchRequestAndResponseStatsRegistry$.&lt;init&gt;(Unknown Source)
      at kafka.consumer.FetchRequestAndResponseStatsRegistry$.&lt;clinit&gt;(Unknown Source)
      at kafka.consumer.SimpleConsumer.&lt;init&gt;(Unknown Source)
      at org.apache.spark.streaming.kafka.KafkaCluster.connect(KafkaCluster.scala:59)
      at org.apache.spark.streaming.kafka.KafkaCluster$$anonfun$org$apache$spark$streaming$kafka$KafkaCluster$$withBrokers$1.apply(KafkaCluster.scala:364)
      at org.apache.spark.streaming.kafka.KafkaCluster$$anonfun$org$apache$spark$streaming$kafka$KafkaCluster$$withBrokers$1.apply(KafkaCluster.scala:361)
      at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
      at scala.collection.mutable.WrappedArray.foreach(WrappedArray.scala:35)
      at org.apache.spark.streaming.kafka.KafkaCluster.org$apache$spark$streaming$kafka$KafkaCluster$$withBrokers(KafkaCluster.scala:361)
      at org.apache.spark.streaming.kafka.KafkaCluster.getPartitionMetadata(KafkaCluster.scala:132)
      at org.apache.spark.streaming.kafka.KafkaCluster.getPartitions(KafkaCluster.scala:119)
      at org.apache.spark.streaming.kafka.KafkaUtils$.getFromOffsets(KafkaUtils.scala:211)
      at org.apache.spark.streaming.kafka.KafkaUtils$.createDirectStream(KafkaUtils.scala:484)
      at org.apache.spark.streaming.kafka.KafkaUtils$.createDirectStream(KafkaUtils.scala:607)
      at com.forrester.streaming.kafka.App$.main(App.scala:19)
      at com.forrester.streaming.kafka.App.main(App.scala)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/0yCIO.png" rel="nofollow noreferrer">Dependecies</a></p>
  
  <p>Dependencies</p>
  
  <pre><code>&lt;dependency&gt;
  &lt;groupId&gt;org.scala-lang&lt;/groupId&gt;
  &lt;artifactId&gt;scala-library&lt;/artifactId&gt;
  &lt;version&gt;2.11.8&lt;/version&gt;
  &lt;scope&gt;provided&lt;/scope&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
  &lt;groupId&gt;com.koverse&lt;/groupId&gt;
  &lt;artifactId&gt;koverse-shaded-deps&lt;/artifactId&gt;
  &lt;version&gt;${koverse.version}&lt;/version&gt;
  &lt;scope&gt;provided&lt;/scope&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
  &lt;groupId&gt;org.apache.spark&lt;/groupId&gt;
  &lt;artifactId&gt;spark-mllib_2.11&lt;/artifactId&gt;
  &lt;version&gt;2.1.0&lt;/version&gt;
  &lt;exclusions&gt;
  &lt;exclusion&gt;
  &lt;groupId&gt;*&lt;/groupId&gt;
  &lt;artifactId&gt;*&lt;/artifactId&gt;
  &lt;/exclusion&gt;
  &lt;/exclusions&gt;
  &lt;/dependency&gt;
  
  
  &lt;dependency&gt;
  &lt;groupId&gt;org.scalanlp&lt;/groupId&gt;
  &lt;artifactId&gt;breeze_2.11&lt;/artifactId&gt;
  &lt;version&gt;0.11.2&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
  &lt;groupId&gt;org.xerial.snappy&lt;/groupId&gt;
  &lt;artifactId&gt;snappy-java&lt;/artifactId&gt;
  &lt;version&gt;1.0.5&lt;/version&gt;
  &lt;/dependency&gt;
  
  
  &lt;dependency&gt;
  &lt;groupId&gt;org.apache.spark&lt;/groupId&gt;
  &lt;artifactId&gt;spark-hive_2.11&lt;/artifactId&gt;
  &lt;version&gt;2.1.0&lt;/version&gt;
  &lt;scope&gt;test&lt;/scope&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;2.1.0&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.11&lt;/artifactId&gt;
  &lt;version&gt;2.1.0&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
  &lt;groupId&gt;org.apache.spark&lt;/groupId&gt;
  &lt;artifactId&gt;spark-sql_2.11&lt;/artifactId&gt;
  &lt;version&gt;2.1.0&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;/dependencies&gt;
  </code></pre>
  
  <p>I did more analysis on different versions:</p>
  
  <pre><code>|Spark build on Scala | Kafka jar                                           |       Result  |
  | ------------------- | --------------------------------------------------- | -------------- |
  | 2.1.1  on 2.11.8    | spark-streaming-kafka-0-8-assembly_2.11-2.1.1.jar   |   **Working** |
  | 2.1.1 on 2.11.8     | spark-streaming-kafka-0-8-assembly_2.10-2.1.1.jar   |   Error as Expected     |
  | 2.1.1 on 2.11.8     | spark-streaming-kafka-0-8-assembly_2.10-2.1.0.jar   |   Error as Expected | 
  | 2.1.0 on 2.11.8     | spark-streaming-kafka-0-8-assembly_2.10-2.1.0.jar   |   Error as Expected |
  | 2.1.0 on 2.11.8     | spark-streaming-kafka-0-8-assembly_2.11-2.1.0.jar   |   **Error : ideally should pass** |
  | 2.1.0 on 2.11.8     | spark-streaming-kafka-0-8-assembly_2.11-2.1.1.jar   |   Error as Expected |
  | 2.1.0 on 2.11.8     | spark-streaming-kafka-0-8-assembly_2.10-2.1.0.jar   |   Error as Expected |
  </code></pre>
  
  <p><strong>Error Message</strong>        ClassNotFoundException: scala.collection.GenTraversableOnce$class          </p>
  
  <p>Case-1 is working but the case-5 is failing which should not throw any error            </p>