Spark : java.lang.ClassNotFoundException: org.apache.hadoop.fs.FSDataInputStream

0 votes

I'm trying the following:

My build.sbt is:


name := Instacart
version := 1.0
scalaVersion :=2.11.8
libraryDependencies ++= Seq(
org.apache.spark %% spark-core % 2.0.0,
org.apache.spark %% spark-sql % 2.0.0)

The sbt package was sucessful

When i am giving spark-submit I got an error:

spark-submit --class Insta --master yarn /mnt/home/edureka_421970/Instacart_sparksql/target/scala-2.11/instacart_2.11-1.0.jar
Exception in thread main java.lang.NoClassDefFoundError: org/apache/hadoop/fs/FSDataInputStream
at org.apache.spark.deploy.SparkSubmitArguments.handleUnknown(SparkSubmitArguments.scala:457)
at org.apache.spark.launcher.SparkSubmitOptionParser.parse(SparkSubmitOptionParser.java:178)
at org.apache.spark.deploy.SparkSubmitArguments.(SparkSubmitArguments.scala:103)
at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:114)
at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.fs.FSDataInputStream
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher.loadClass(Launcher.java:335)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 5 more
Jan 2 in Big Data Hadoop by slayer
• 29,050 points
1,292 views

1 answer to this question.

0 votes

Create a spark-env.cmd file looking like this

@echo off set HADOOP_HOME=D:\Utils\hadoop-2.7.1
set PATH=%HADOOP_HOME%\bin;%PATH% 
set SPARK_DIST_CLASSPATH=<paste here the output of %HADOOP_HOME%\bin\hadoop classpath>

If this does not work, check if you have mentioned the right spark version in build.sbt

answered Jan 2 by Omkar
• 67,290 points

Related Questions In Big Data Hadoop

0 votes
1 answer
0 votes
1 answer

Hadoop Java Error: java.lang.NoClassDefFoundError: WordCount (wrong name: org/myorg/WordCount)

Hey, try this code import java.io.IOException; import java.util.Iterator; import java.util.StringTokenizer; import ...READ MORE

answered Sep 19, 2018 in Big Data Hadoop by slayer
• 29,050 points
766 views
0 votes
1 answer

Hadoop: "Caused by: java.lang.ClassNotFoundException" error

Have you placed the jar files in ...READ MORE

answered Nov 19, 2018 in Big Data Hadoop by Omkar
• 67,290 points
821 views
0 votes
1 answer
0 votes
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 10,510 points
2,400 views
0 votes
1 answer

hadoop.mapred vs hadoop.mapreduce?

org.apache.hadoop.mapred is the Old API  org.apache.hadoop.mapreduce is the ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 10,510 points
245 views
0 votes
10 answers

hadoop fs -put command?

put syntax: put <localSrc> <dest> copy syntax: copyFr ...READ MORE

answered Dec 7, 2018 in Big Data Hadoop by Aditya
12,219 views
0 votes
1 answer

java.lang.NoSuchMethodError: org.apache.hadoop.fs.FSOutputSummer

Seems like you have not set the ...READ MORE

answered Jan 28 in Big Data Hadoop by Omkar
• 67,290 points
122 views
0 votes
1 answer

Hadoop Pig: java.lang.NoClassDefFoundError: org/apache/hadoop/hbase/filter/Filter

This seems like a problem with the ...READ MORE

answered Nov 16, 2018 in Big Data Hadoop by Omkar
• 67,290 points
188 views