java.lang.NoClassDefFoundError: org/apache/spark/Logging
org.apache.spark.Logging is available in Spark version 1.5.2 or lower version. It is not in the 2.0.0. Pls change versions as follows
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-streaming_2.11</artifactId>
<version>1.5.2</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.10</artifactId>
<version>1.5.2</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-sql_2.10</artifactId>
<version>1.5.2</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-streaming-kafka-0-8_2.11</artifactId>
<version>1.6.2</version>
</dependency>
Resolving NoClassDefFoundError: org/apache/spark/Logging exception
Sean Owen suggested in http://community.cloudera.com/t5/Advanced-Analytics-Apache-Spark/Hit-quot-Exception-in-thread-main-java-lang-NoClassDefFoundError/td-p/44486 that "You shouldn't use org.apache.spark.Logging in your app at all. That's likely the problem and solution."
So you should be using the following or higher version
<!-- https://mvnrepository.com/artifact/commons-logging/commons-logging -->
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
Updated
I specified that and now I am getting NoClassDefFoundError: org/apache/spark/streaming/dstream/DStream
for the above issue you need following dependency
<!-- https://mvnrepository.com/artifact/org.apache.spark/spark-streaming -->
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-streaming_2.11</artifactId>
<version>2.0.0</version>
<scope>provided</scope>
</dependency>
Spark: Exception in thread main java.lang.NoClassDefFoundError: org/apache/spark/Logging
The problem is that org.apache.spark.Logging
is only available in Spark 1.5.2 or lower, and this class is a dependency of org.apache.spark.streaming.twitter
.
Since Spark 1.5.2 is not available for Scala 2.12, we should downgrade to Scala 2.11.
So a sbt file that makes this application works is the following
name := "SparkStreaming"
version := "0.1"
scalaVersion := "2.11.12"
libraryDependencies ++= Seq(
"org.apache.spark" %% "spark-core" % "1.5.2",
"org.apache.spark" %% "spark-sql" % "1.5.2",
"org.apache.spark" %% "spark-streaming" % "1.5.2",
"org.apache.spark" %% "spark-streaming-twitter" % "1.6.3"
)
Zeppelin: java.lang.NoClassDefFoundError: org/apache/spark/Logging
I found the solution by adding the jar
spark-core_2.11-1.5.2.logging.jar
Related Topics
How to Test If My Font Is Rendered Correctly in PDF
Why Does Autoreconnect=True Not Seem to Work
@Transactional Method Called from Another Method Doesn't Obtain a Transaction
Which Concurrent Queue Implementation Should I Use in Java
Abstractmethoderror Using Uribuilder on Jax-Rs
If(False) VS. While(False): Unreachable Code VS. Dead Code
How to Shuffle Characters in a String Without Using Collections.Shuffle(...)
Java Equivalent to #Region in C#
Check If a File Is Locked in Java
Garbage Collection on a Local Variable
Create MySQL Database from Java
What Determines Kafka Consumer Offset
Iterating Through a List in Reverse Order in Java
Extract String Between Two Strings in Java
Error Message "Unreported Exception Java.Io.Ioexception; Must Be Caught or Declared to Be Thrown"
Should I Use Java.Util.Date or Switch to Java.Time.Localdate