1

When I submit the spark application, getting the below error:

Exception in thread "streaming-start" java.lang.NoSuchMethodError:

org.apache.kafka.clients.consumer.KafkaConsumer.subscribe(Ljava/util/Collection;)V

Went through the below URL: http://apache-spark-developers-list.1001551.n3.nabble.com/testing-the-kafka-0-10-connector-td17956.html

Set the below environment variable: SPARK_KAFKA_VERSION=0.10

Added the below dependency:

<dependency>
  <groupId>org.apache.spark</groupId>
  <artifactId>spark-streaming-kafka-0-10_2.11</artifactId>
  <version>2.1.0.cloudera1</version>
</dependency>

Added the below jar: spark-streaming-kafka-0-10-assembly_2.11.jar

Versions I'm using:

  • Spark-2.0.2
  • Scala-2.11
  • Kafka-0.10

A piece of code:

val CLASS_NAME = this.getClass
val log = org.apache.log4j.LogManager.getLogger(CLASS_NAME)

Your help is highly appreciated.

1 Answer 1

3

Try seting this:

export SPARK_KAFKA_VERSION=0.10

Sign up to request clarification or add additional context in comments.

3 Comments

THANK YOU! This helped me get past the annoying method not found error. You saved my day.
Why is it required ?
Yeah, why is this required?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.