hadoop No FileSystem for scheme: hdfs
http://stackoverflow.com/questions/17265002/hadoop-no-filesystem-for-scheme-file
This is a typical case of the maven-assembly plugin breaking things.
Why this happened to us
Differents JARs (hadoop-commons for LocalFileSystem, hadoop-hdfs for DistributedFileSystem) each contain a different file called org.apache.hadoop.fs.FileSystem in their META-INFO/servicesdirectory. This file lists the canonical classnames of the filesystem implementations they want to declare (This is called a Service Provider Interface, see org.apache.hadoop.FileSystem line 2116).
When we use maven-assembly, it merges all our JARs into one, and all META-INFO/services/org.apache.hadoop.fs.FileSystem overwrite each-other. Only one of these files remains (the last one that was added). In this case, the Filesystem list from hadoop-commons overwrites the list from hadoop-hdfs, so DistributedFileSystem was no longer declared.
How we fixed it
After loading the hadoop configuration, but just before doing anything Filesystem-related, we call this:
hadoopConfig.set("fs.hdfs.impl",
org.apache.hadoop.hdfs.DistributedFileSystem.class.getName()
);
hadoopConfig.set("fs.file.impl",
org.apache.hadoop.fs.LocalFileSystem.class.getName()
);
hadoop No FileSystem for scheme: hdfs的更多相关文章
- Eclipse maven hadoop -- java.io.IOException: No FileSystem for scheme: hdfs
2019-01-10 概述 今天在Windows系统下新安装了Eclipse和maven的环境,想利用Maven构建一个Hadoop程序的,结果却发现程序运行时一直报 “No FileSystem f ...
- MapReduce 踩坑 - hadoop No FileSystem for scheme: file/hdfs
一.场景 hadoop-3.0.2 + hbase-2.0.0 一个mapreduce任务,在IDEA下本地提交到hadoop集群可以正常运行. 现在需要将IDEA本地项目通过maven打成jar包, ...
- Hadoop 3.1.2报错:xception in thread "main" org.apache.hadoop.fs.UnsupportedFileSystemException: No FileSystem for scheme "hdfs"
报错内容如下: Exception in thread "main" org.apache.hadoop.fs.UnsupportedFileSystemException: No ...
- java.io.IOException: No FileSystem for scheme: hdfs
在这篇文章中,介绍了如何将Maven依赖的包一起打包进jar包.使用maven-assembly打成jar后,将这个jar提供给其他工程引用的时候,报出如下错误: log4j:WARN No appe ...
- 【甘道夫】HBase开发环境搭建过程中可能遇到的异常:No FileSystem for scheme: hdfs
异常: 2014-02-24 12:15:48,507 WARN [Thread-2] util.DynamicClassLoader (DynamicClassLoader.java:<in ...
- 解决:java.io.IOException: No FileSystem for scheme: hdfs
解决:java.io.IOException: No FileSystem for scheme: hdfs 开发项目初期,写完代码开始放到服务器上开始测试的时候,报出这样的一个错,不知道怎么处理了, ...
- spark运行java-jar:Exception in thread "main" java.io.IOException: No FileSystem for scheme: hdfs
今天碰到的一个 spark问题,困扰好久才解决 首先我的spark集群部署使用的部署包是官方提供的 spark-1.0.2-bin-hadoop2.tgz 部署在hadoop集群上. 在运行java ...
- No FileSystem for scheme: hdfs问题
通过FileSystem.get(conf)初始化的时候,要通过静态加载来实现,其加载类的方法代码如下: private static FileSystem createFileSystem(URI ...
- Java程序中不通过hadoop jar的方式访问hdfs
一般情况下,我们使用Java访问hadoop distributed file system(hdfs)使用hadoop的相应api,添加以下的pom.xml依赖(这里以hadoop2.2.0版本 ...
随机推荐
- ListView控件的用法
listView是一个可以用来显示视图列表的控件. 它使用适配器来为之提供数据和资源. ListView使用的基本步骤 得到ListView类型的对象mListView 生成适配器对象mListVie ...
- sql server 判断日期当前月有多少天
declare @tm datetime set @tm = CONVERT(datetime,'2013-3-12')declare @days intselect @days = case whe ...
- spring aop配置及用例说明(3)
欢迎转载交流:http://www.cnblogs.com/shizhongtao/p/3476336.html 1.这里说一下aop的@Around标签,它提供了在方法开始和结束,都能添加用户业务逻 ...
- C++四种强制类型转换关键字
C语言使用强制类型转换(Type Cast)很简单,不管什么类型的转换,形式都如下: TYPE b = (TYPE)a; c++提供了4种类型转换操作符来应对不同场合的应用. const_cast ...
- c# Aes加解密和对象序列化
aes加解密 public class AesCryptto { private string key = "hjyf57468jhmuist"; private string i ...
- DTCMS中部分IE8不支持webupload上传附件的控件,更改为ajaxfileupload
dialog\dialog_attach.aspx <!DOCTYPE html> <html> <head> <meta http-equiv=" ...
- ajax分页效果实现
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title&g ...
- Kakfa揭秘 Day9 KafkaReceiver源码解析
Kakfa揭秘 Day9 KafkaReceiver源码解析 上一节课中,谈了Direct的方式来访问kafka的Broker,今天主要来谈一下,另一种方式,也就是KafkaReceiver. 初始化 ...
- 通过 struct 成员地址 获取 struct 结构体地址
1. 问题描述: 现在定义了一个结构体: struct Foo { int a; int b; }; Foo foo; 假如由于函数传参等原因,现在程序只能拿到 foo.b 的地址,这时想通过某种方法 ...
- 【EF】 proxy
逐步解說:使用 WCF 序列化 POCO Proxy (Entity Framework) .NET Framework 4 POCO Proxy 型別無法由 Windows Communicat ...