Wrong FS: hdfs://xxx/xxx expected: file:///
Eclipse调用HDFS API上传文件时出现了如下错误:
Exception in thread "main" java.lang.IllegalArgumentException: Wrong FS: hdfs://master:9000/user/Administrator, expected: file:///
at org.apache.hadoop.fs.FileSystem.checkPath(FileSystem.java:659)
at org.apache.hadoop.fs.RawLocalFileSystem.pathToFile(RawLocalFileSystem.java:82)
at org.apache.hadoop.fs.RawLocalFileSystem.deprecatedGetFileStatus(RawLocalFileSystem.java:585)
at org.apache.hadoop.fs.RawLocalFileSystem.getFileLinkStatusInternal(RawLocalFileSystem.java:803)
at org.apache.hadoop.fs.RawLocalFileSystem.getFileStatus(RawLocalFileSystem.java:580)
at org.apache.hadoop.fs.FilterFileSystem.getFileStatus(FilterFileSystem.java:425)
at org.apache.hadoop.fs.FileSystem.exists(FileSystem.java:1414)
at org.apache.hadoop.fs.FileUtil.checkDest(FileUtil.java:499)
at org.apache.hadoop.fs.FileUtil.copy(FileUtil.java:351)
at org.apache.hadoop.fs.FileUtil.copy(FileUtil.java:341)
at org.apache.hadoop.fs.FileUtil.copy(FileUtil.java:292)
at org.apache.hadoop.fs.LocalFileSystem.copyFromLocalFile(LocalFileSystem.java:82)
at org.apache.hadoop.fs.FileSystem.copyFromLocalFile(FileSystem.java:1884)
at com.hellohadoop.FileOperator.Upload(FileOperator.java:48)
at com.hellohadoop.FileOperator.main(FileOperator.java:23)
解决的办法是把Hadoop集群的hdfs-site.xml和core-site.xml两个配置文件复制到项目的bin目录下面,就可以正常运行了。
Wrong FS: hdfs://xxx/xxx expected: file:///的更多相关文章
- Hadoop问题记录:Wrong FS: hdfs://hp5-249:9000/, expected: file:///
一般在对文件操作的时候可能出现这个问题,可能是打开文件的时候出错,也可能是对文件夹进行遍历的时候出问题. 出现这样的问题通常是在eclipse中执行hadoop的时候出现,直接切换到shell下发送命 ...
- hadoop程序问题:java.lang.IllegalArgumentException: Wrong FS: hdfs:/ expected file:///
Java代码如下: FileSystem fs = FileSystem.get(conf); in = fs.open(new Path("hdfs://192.168.130.54:19 ...
- hadoop运行报错Wrong FS: hdfs:/, expected: file:///
内容源自:https://blog.csdn.net/u014470581/article/details/51480600 报错信息: Exception in thread "main& ...
- Error Domain=ASIHTTPRequestErrorDomain Code=8 "Failed to move file from"xxx/xxx"to"xxx/xxx"
今天真的好高兴呀 我解决了一个折磨了我一周的问题,真的是激动地要哭出来了,为了这个问题,我嘴也烂了,头发抓了一地啊.虽然解决方法,最后还是展现出了“百度”的伟大,但是我还是很开心,在这里我展示一下我的 ...
- Visual Studio发布Web项目报错:Unable to add 'xxx' to the Web site. Unable to add file 'xxx'. The specified file could not be encrypted.
背景 Visual Studio下的Web项目 现象 发布时遇到Unable to add 'xxx' to the Web site. Unable to add file 'xxx'. The ...
- RLException: XXX is neither a launch file in package XXX nor is XXX a launch file name问题解决
在运行roslaunch时出现了类似下面的错误: RLException: XXX is neither a launch file in package XXX nor is XXX a launc ...
- Cocos2d-x执行时错误:Cocos2d: Get data from file(xxx.xxx) failed!
取资源图片时遇到执行时错误: Cocos2d: Get data from file(xxx/xxx.xxx) failed! 原因是我加入资源目录的方式不正确,例如以下图,我选择的是在Resourc ...
- 多数据源报错 expected single matching bean but found 2: xxx,xxx
问题: expected single matching bean but found 2: xxx,xxx 原因:在 Spring 容器中配置了两个类型Bean,Spring 容器将无法确定到底要用 ...
- Error creating bean with name 'XXX' defined in file
这个错误是我在之前操作时,错将另一个dubbo服务器也加载到了该dubbo服务器上(pom.xml),所以出现了Error creating bean with name 'XXX' defined ...
随机推荐
- PL/SQL报错:Initialization error Oracle client not properly installed
安装PL/SQL8.4后,连接数据库 提示错误Initialization error Oracle client not properly installed 解决方案: 1.下载instancec ...
- 危机边缘第五季/全集Fringe迅雷下载
本季Fringe Season 5 第五季(2012)看点:Walter 用琥珀将Olivia.Peter.Astrid和自己封存,以便在2036年的未来世界实现自己抵抗观察者的完美计划,“解冻”后的 ...
- libjpeg的问题
游戏项目是基于cocos2d-x开发的,但线上发现一个bug就是玩家在设置完自定义头像后直接闪退.凡是在设置该玩家头像的地方,游戏就直接闪退.最终定位到的问题是图片数据源有问题,我的机器是win7,图 ...
- putty adb
putty.exe -adb -P 5037 transport-usb 网络调试也是可以的 先connect 再执行上面的命令 http://files.cnblogs.com/files/ahuo ...
- PHP获取指定函数定义在哪个文件中及行号
当调试开源的代码时,希望查看某个函数的定义,那么就需要定位其位置.特别是有的项目中,函数会有多个地方都有定义,那么如果我想知道当前调用的这个函数是在哪里定义的,可以用下面这个方法. function ...
- .Net Excel操作之NPOI(二)常用操作封装
一.Excel数据导出常用操作 1.指定表头和描述 2.指定数据库中读出的数据集合 二.ExcelExport封装 /// <summary> /// Excel常用的表格导出逻辑封装 / ...
- .Net Standard Http请求实例
一 ..Net Standard http协议封装 程序集: System.Net.Http.dll 命名 空间:System.Net.Http HttpClient :http请求 发送类 Form ...
- yolo源码解析(二)
五 读取数据pascal_voc.py文件解析 我们在YOLENet类中定义了两个占位符,一个是输入图片占位符,一个是图片对应的标签占位符,如下: #输入图片占位符 [NONE,image_size, ...
- 【UOJ Round #3】
枚举/二分 C题太神窝看不懂…… 核聚变反应强度 QwQ很容易发现次小的公约数一定是gcd的一个约数,然后……我就傻逼地去每次算出a[1],a[i]的gcd,然后枚举约数……这复杂度……哦呵呵... ...
- Team Foundation(通常记作“TFS”)
ylbtech-Miscellaneos:Team Foundation(通常记作“TFS”) Team Foundation是一个服务平台,为 Microsoft 提供源代码管理数据收集报告等工作. ...