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, 2019 in Big Data Hadoop by slayer
• 29,370 points
12,008 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, 2019 by Omkar
• 69,220 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,370 points
6,213 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
• 69,220 points
7,049 views
+1 vote
2 answers
+1 vote
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
• 11,380 points
11,073 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
• 11,380 points
2,572 views
+2 votes
11 answers

hadoop fs -put command?

Hi, You can create one directory in HDFS ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points
109,061 views
0 votes
1 answer

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

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

answered Jan 29, 2019 in Big Data Hadoop by Omkar
• 69,220 points
3,532 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
• 69,220 points
2,060 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP