Java MapReduce error saying No FileSystem for scheme:hdfs

0 votes

I am writing java code to upload a file to HDFS. So, my code is as follows:

Configuration configuration = new Configuration();
configuration.set(“fs.hdfs.impl”, org.apache.hadoop.DistributedFileSystem.class.getName());
Filesystem filesystem = FileSystem.get(URI.create(remote), configuration);

I included the following dependencies while executing the project:

  • hadoop-auth-2.6.1.jar
  • hadoop-common-2.6.1.jar 
  • hadoop-hdfs-2.6.1.jar

While executing the project I got an error saying

No FileSystem for scheme:hdfs

Can anyone tell me what is wrong with my code?

May 9, 2018 in Big Data Hadoop by nitinrawat895
• 10,110 points
224 views

1 answer to this question.

0 votes
The problem is with the dependencies. The DistributedFileSystem is present in hadoop-core package. So, I guess you haven’t given the hadoop-core dependencies.

Import hadoop-core jar from org.apache.hadoop package.

One more important thing, sometimes we also get this issue if the version of Hadoop is different from the version of jar dependencies that you are using. So kindly look at the version of Hadoop that you are using & the version of jars that you are importing.
answered May 9, 2018 by Shubham
• 13,190 points

Related Questions In Big Data Hadoop

0 votes
1 answer

How to create a FileSystem object that can be used for reading from and writing to HDFS?

Read operation on HDFS In order to read ...READ MORE

answered Mar 21, 2018 in Big Data Hadoop by nitinrawat895
• 10,110 points

edited Mar 21, 2018 by nitinrawat895 213 views
0 votes
1 answer
0 votes
1 answer

Hadoop MapReduce wordcount "type job is not applicable for the arguments" error

The combiner class is not required in ...READ MORE

answered Dec 19, 2018 in Big Data Hadoop by Omkar
• 67,120 points
27 views
0 votes
1 answer

Getting error when writing to HDFS. Unable to load native-hadoop library for your platform

Try this: sudo service hadoop-master restart After that try ...READ MORE

answered Dec 19, 2018 in Big Data Hadoop by Omkar
• 67,120 points
96 views
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,110 points
2,053 views
0 votes
10 answers

hadoop fs -put command?

copy command can be used to copy files ...READ MORE

answered Dec 7, 2018 in Big Data Hadoop by Sujay
10,500 views
0 votes
1 answer

Hadoop dfs -ls command?

In your case there is no difference ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by kurt_cobain
• 9,240 points
765 views
0 votes
1 answer
0 votes
1 answer

Getting error in command hdfs dfs -mkdir

You are getting this error because the ...READ MORE

answered Apr 15, 2018 in Big Data Hadoop by Shubham
• 13,190 points
383 views
0 votes
1 answer

Getting error in MapReduce job.setInputFormatClass

In old Hadoop API(i.e. below Hadoop 0.20.0), ...READ MORE

answered Apr 15, 2018 in Big Data Hadoop by Shubham
• 13,190 points
268 views