Ravi
Ravi

Reputation: 15

The following method did not exist: scala.Product.$init$(Lscala/Product;)V

<dependency>
    <groupId>org.apache.spark</groupId>
    spark-core_2.12
    <version>2.4.0</version>
</dependency>

<dependency>
    <groupId>org.apache.spark</groupId>
    spark-streaming_2.12
    <version>2.4.0</version>
    <scope>provided</scope>
</dependency>

<dependency>
    <groupId>org.apache.spark</groupId>
    spark-streaming-kafka_2.11
    <version>1.6.3</version>
</dependency>

<dependency>
    <groupId>org.scala-lang</groupId>
    scala-library
    <version>2.11.12</version>
</dependency>

I am using above version. Why am I getting this error?

Upvotes: 0

Views: 718

Answers (1)

Dmytro Mitin
Dmytro Mitin

Reputation: 51703

You're using versions of libraries for different Scala: 2.12 and 2.11.

Please use either

spark-core_2.12
spark-streaming_2.12
spark-streaming-kafka_2.12
scala-library  2.12.x

(spark-streaming-kafka_2.12 does not exist) or

spark-core_2.11
spark-streaming_2.11
spark-streaming-kafka_2.11
scala-library  2.11.x

Exception in thread "main" java.lang.NoSuchMethodError: scala.Product.$init$(Lscala/Product;)

java.lang.NoSuchMethodError: scala.Product.$init$(Lscala/Product;)V

Upvotes: 1

Related Questions