解决方案是,在设置hadoop的配置的时候,显示设置这个类:"org.apache.hadoop.hdfs.DistributedFileSystem:
configuration.set("fs.hdfs.impl", "org.apache.hadoop.hdfs.DistributedFileSystem");