Wednesday, 20 April 2022

UnsupportedFileSystemException No FileSystem for scheme "hdfs"

No FileSystem for scheme \"hdfs\"\n\tat 

stacktrace":"org.apache.hadoop.fs.UnsupportedFileSystemException:

No FileSystem for scheme \"hdfs\"\n\tat org.apache.hadoop.fs.FileSystem.getFileSystemClass(FileSystem.java:)\n\

tat org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:)

\n\tat org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:)\n\

tat org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:)\n\

tat org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:)\n\t

at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:)\n

\tat org.apache.hadoop.fs.FileSystem.get(FileSystem.java:)\n

Solution 

This Error is due to unavailability of required libarary during FS object creation

Add hadoop-hdfs and hadoop-hdfs-client jars as runtime depedency to your project

POM:

.....

 <dependency>

  <groupId>org.apache.hadoop</groupId>

  <artifactId>hadoop-hdfs-client</artifactId>

  <version>3.0.0</version>

</dependency>

<dependency>

  <groupId>org.apache.hadoop</groupId>

  <artifactId>hadoop-hdfs</artifactId>

  <version>3.0.0</version>

</dependency>

-------------------------------------------------------------------------------------------------------

13 comments: