I changed the hadoop project in eclipse to a workspace, and when I started the task again, I found that the following exception was reported:
- 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)
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)
The reason is generally that the jar package hadoop-hdfs.jar is not imported.
After importing the package, re-compile ant, submit the task, and it runs normally!