人人IT網

人人IT網

當前位置: 主頁 > JAVA編程 > JAVA >

Could not locate executable null\bin\winutils.exe in the hadoop binary path

時間:2014-05-19 19:20來源:Internet 作者:Internet 點擊:
    CDH5環境,客戶端調用HBase JAVA API做查詢,報錯如下:      10:02:13,492 [main] ERROR Shell : Failed to locate the

    CDH5環境,客戶端調用HBase JAVA API做查詢,報錯如下:

    

10:02:13,492 [main] ERROR  Shell : Failed to locate the winutils binary in the hadoop binary path
java.io.IOException: Could not locate executable null\bin\winutils.exe in the Hadoop binaries.
	at org.apache.hadoop.util.Shell.getQualifiedBinPath(Shell.java:278)
	at org.apache.hadoop.util.Shell.getWinUtilsPath(Shell.java:300)
	at org.apache.hadoop.util.Shell.<clinit>(Shell.java:293)
	at org.apache.hadoop.util.StringUtils.<clinit>(StringUtils.java:76)
	at org.apache.hadoop.conf.Configuration.getTrimmedStrings(Configuration.java:1546)
	at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:556)
	at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:490)
	at org.apache.hadoop.hdfs.DistributedFileSystem.initialize(DistributedFileSystem.java:136)
	at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2433)
	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 org.apache.hadoop.fs.FileSystem.get(FileSystem.java:166)
        ....

 

    搞笑的解决方案:

    在代碼中添加如下:

    

File workaround = new File(".");
        System.getProperties().put("hadoop.home.dir", workaround.getAbsolutePath());
        new File("./bin").mkdirs();
        new File("./bin/winutils.exe").createNewFile();

    bug地址:http://go.rritw.com/issues.cloudera.org/browse/DISTRO-544


From:ITEYE
頂一下
(0)
0%
踩一下
(2)
100%
------分隔線----------------------------
發表評論
請自覺遵守互聯網相關的政策法規,嚴禁發布色情、暴力、反動的言論。
評價:
表情:
驗證碼:點擊我更換圖片
欄目列表
推薦內容
娱乐城 博彩 百家乐 真钱娱乐 棋牌 东方鸿运娱乐城 和记送彩金在线赌场 凯时现金网娱乐城