Resolution: Java.io.IOException:No FileSystem for Scheme:hdfs

Source: Internet
Author: User

Solution: java.io.IOException:No FileSystem for Scheme:hdfs

Development project early, write the code began to put on the server to start testing, reported such a mistake, do not know how to deal with, tried to reconfigure the configuration of HDFs, also no, helpless, had to look at the source code, analysis of where the error is reported from.

First of all, hadoop-common-2.6.0-cdh5.7.0 this jar package decompression, according to the error class, find the corresponding method, using the Anti-compilation tool to open the FileSystem class, to see the implementation of the source code, first look at the Get method:

This get method has the method of creating filesystem, Createfilesystem is used to create the filesystem, the possibility of error, only in this method, because this method is reading our configuration file, that is, config. We open Createfilesystem This method to continue to follow the implementation of the source code:

From this method, we can see the error message and under what circumstances he will report such a mistake, knowing the source, our problem is much better solved, from the code can be seen, when the class classz is empty when the No FileSystem for scheme this error, Looking up, this object is created by Getfilesystemclass, which is returned by this method, and we open this method again:

Seeing the problem here, this method needs to read "FS." as defined in Core-default.xml. +scheme+ ". Impl", here is read Fs.hdfs.impl This configuration information, this information is not configured in the configuration file Core-default.xml, so will be an error, we found this configuration file:

Open this configuration file, turn to the last found no related configuration, add the specified implementation class configuration, add these words:

So read the configuration file, load the class on it, re-test, the problem is resolved.

Summary: This error occurs because the project Hadoop version was upgraded during the development process, and the old version of the jar package does not have the implementation class configuration for this method, so it cannot be found. Because the beginning of the import is our previous project jar package, all still can not lazy, import the corresponding new version of the jar package. In addition, in the face of problems, do not worry, first find out the possible solutions Aberdeen, really not, look at the source code, find out the source of the problem, clues, step by step to find out the cause, the problem can be solved smoothly.

Resolution: Java.io.IOException:No FileSystem for Scheme:hdfs

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.