首页 > 代码库 > Error: java.lang.UnsupportedOperationException: Not implemented by the HftpFileSystem FileSystem imp

Error: java.lang.UnsupportedOperationException: Not implemented by the HftpFileSystem FileSystem imp

Error: java.lang.UnsupportedOperationException: Not implemented by the HftpFileSystem FileSystem implementation
	at org.apache.hadoop.fs.FileSystem.getScheme(FileSystem.java:214)
	at org.apache.hadoop.fs.FileSystem.loadFileSystems(FileSystem.java:2365)
	at org.apache.hadoop.fs.FileSystem.getFileSystemClass(FileSystem.java:2375)
	at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2392)
	at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:89)
	at org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:2431)
	at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:2413)
	at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:368)
	at org.apache.hadoop.fs.FileSystem.getLocal(FileSystem.java:339)
	at org.apache.hadoop.fs.LocalDirAllocator$AllocatorPerContext.confChanged(LocalDirAllocator.java:270)
	at org.apache.hadoop.fs.LocalDirAllocator$AllocatorPerContext.getLocalPathToRead(LocalDirAllocator.java:432)
	at org.apache.hadoop.fs.LocalDirAllocator.getLocalPathToRead(LocalDirAllocator.java:164)
	at org.apache.hadoop.mapred.YarnChild.configureLocalDirs(YarnChild.java:232)
	at org.apache.hadoop.mapred.YarnChild.configureTask(YarnChild.java:290)
	at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:147)

问题原因:字面意思来看就是FileSystem的一些方法(getScheme等)没有被实现,主要原因是hadoop-hdfs的jar包冲突(调用的hadoop-hdfs的jar包没有找到该方法)

解决办法:Maven的pom.xml文件,选择“Dependency Hierarchy”,输入“hadoop-hdfs”,查看哪些jar包引入了hadoop-hdfs-XXX.jar,以及查看这些hadoop-hdfs-xxx.jar中是否有getScheme等方法,如果没有,说明这个hadoop-hdfs-xxx.jar可能是导致冲突的包,注释之避免引起jar包冲突


PS:解决Maven的jar包冲突参考:http://blog.csdn.net/yeweiouyang/article/details/39319355

Error: java.lang.UnsupportedOperationException: Not implemented by the HftpFileSystem FileSystem imp