Hadoop2.2异常No FileSystem for scheme: hdfs

把eclipse中的hadoop项目,换了一个工作空间,再次启动任务时,发现报如下异常:
java.io.IOException: No FileSystem for scheme: hdfs
        at org.apache.hadoop.fs.FileSystem.getFileSystemClass(FileSystem.java:2421)
        at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2428)
        at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:88)
        at org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:2467)
        at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:2449)
        at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:367)
        at FileCopyToHdfs.readFromHdfs(FileCopyToHdfs.java:65)
        at FileCopyToHdfs.main(FileCopyToHdfs.java:26)


原因一般是,少导入hadoop-hdfs.jar这个jar包,

Hadoop2.2异常No FileSystem for scheme: hdfs

导入该包后,重新ant编译,提交任务,运行正常!

你可能感兴趣的:(java,eclipse,hadoop)