开发者社区> biehl> 正文

java.io.IOException: Could not locate executable null\bin\winutils.exe in the Hadoop binaries.

简介: 1:这个问题都被大家玩烂了,这里我也记载一下,方便以后脑补: 1 SLF4J: Class path contains multiple SLF4J bindings. 2 SLF4J: Found binding in [jar:file:/E:/360Downloads/hadoop-2.
+关注继续查看

1:这个问题都被大家玩烂了,这里我也记载一下,方便以后脑补:

 1 SLF4J: Class path contains multiple SLF4J bindings.
 2 SLF4J: Found binding in [jar:file:/E:/360Downloads/hadoop-2.4.1/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
 3 SLF4J: Found binding in [jar:file:/E:/360Downloads/hbase-0.99.2/lib/slf4j-log4j12-1.7.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
 4 SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
 5 SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
 6 2017-12-18 18:06:27,778 WARN  [main] util.NativeCodeLoader (NativeCodeLoader.java:<clinit>(62)) - Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
 7 2017-12-18 18:06:27,786 ERROR [main] util.Shell (Shell.java:getWinUtilsPath(336)) - Failed to locate the winutils binary in the hadoop binary path
 8 java.io.IOException: Could not locate executable null\bin\winutils.exe in the Hadoop binaries.
 9     at org.apache.hadoop.util.Shell.getQualifiedBinPath(Shell.java:318)
10     at org.apache.hadoop.util.Shell.getWinUtilsPath(Shell.java:333)
11     at org.apache.hadoop.util.Shell.<clinit>(Shell.java:326)
12     at org.apache.hadoop.util.StringUtils.<clinit>(StringUtils.java:76)
13     at org.apache.hadoop.security.Groups.parseStaticMapping(Groups.java:93)
14     at org.apache.hadoop.security.Groups.<init>(Groups.java:77)
15     at org.apache.hadoop.security.Groups.getUserToGroupsMappingService(Groups.java:240)
16     at org.apache.hadoop.security.UserGroupInformation.initialize(UserGroupInformation.java:255)
17     at org.apache.hadoop.security.UserGroupInformation.ensureInitialized(UserGroupInformation.java:232)
18     at org.apache.hadoop.security.UserGroupInformation.loginUserFromSubject(UserGroupInformation.java:718)
19     at org.apache.hadoop.security.UserGroupInformation.getLoginUser(UserGroupInformation.java:703)
20     at org.apache.hadoop.security.UserGroupInformation.getCurrentUser(UserGroupInformation.java:605)
21     at org.apache.hadoop.hbase.security.User$SecureHadoopUser.<init>(User.java:256)
22     at org.apache.hadoop.hbase.security.User$SecureHadoopUser.<init>(User.java:252)
23     at org.apache.hadoop.hbase.security.User.getCurrent(User.java:156)
24     at org.apache.hadoop.hbase.security.UserProvider.getCurrent(UserProvider.java:88)
25     at org.apache.hadoop.hbase.client.ConnectionFactory.createConnection(ConnectionFactory.java:215)
26     at org.apache.hadoop.hbase.client.ConnectionFactory.createConnection(ConnectionFactory.java:119)
27     at com.hbaseTest.HbaseTest.init(HbaseTest.java:57)
28     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
29     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
30     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
31     at java.lang.reflect.Method.invoke(Method.java:606)
32     at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
33     at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
34     at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
35     at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
36     at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
37     at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
38     at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
39     at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
40     at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
41     at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
42     at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
43     at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
44     at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
45     at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
46     at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
47     at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
48     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
49     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
50     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
51     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

我是测试Hbase创建数据表的时候遇到的这种问题,总之吧,window操作hadoop都会遇到这种问题:

 1 第一步:自己配置window的环境变量(很明显应该是HADOOP_HOME的问题。如果HADOOP_HOME为空,必然fullExeName为null\bin\winutils.exe。解决方法很简单,配置环境变量,)。
 2 第二步:不想重启电脑可以在程序里加上:
 3 System.setProperty("hadoop.home.dir", "C:\\Users\\Administrator\\Desktop\\hadoop-2.7.3\\hadoop-2.7.3");
 4 比如我添加到此处:
 5 @Before
 6     public void init() throws Exception {
 7         System.setProperty("hadoop.home.dir", "E:\\hadoop-2.6.4");
 8         // 配置
 9         config = HBaseConfiguration.create();
10         // zookeeper地址
11         config.set("hbase.zookeeper.quorum", "master,slaver1,slaver2");
12         // zookeeper端口
13         config.set("hbase.zookeeper.property.clientPort", "2181");
14         // 通过工厂模式创建一个Connection
15         connection = ConnectionFactory.createConnection(config);
16         // 通过Connection获取表连接
17         table = connection.getTable(TableName.valueOf("user"));
18 }
19 第三步:去https://github.com/srccodes/hadoop-common-2.2.0-bin/tree/master/bin    
20 下载winutils.exe文件复制到自己的E:\hadoop-2.6.4\bin目录里面。
21 第四步:重新运行程序就OK了,问题解决。

停更......

版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

相关文章
java.io.IOException: Could not locate executable null\bin\winutils.exe in the Hadoop binaries.
在Win7系统Intellij开发工具中调试Spark读取Hbase。运行直接报异常 java.io.IOException: Could not locate executable null\bin\winutils.
2589 0
java.io.IOException: The same input jar [E:\Jre\lib\rt.jar] is specified twice.
执行Maven Install打包的时候,出现以下错误信息: [INFO] proguard jar: E:\maven\mvnRespo\net\sf\proguard\proguard-base\5.
958 0
kylin_异常_01_java.io.FileNotFoundException: /developer/apache-kylin-2.3.0-bin/tomcat/conf/.keystore
一、异常现象 kylin安装完,启动后,控制正常,kylin后台也能正常访问。但是去看kylin的日志,却发现报错了: SEVERE: Failed to load keystore type JKS with path conf/.
2581 0
Hadoop启动报Error: JAVA_HOME is not set and could not be found解决办法
Hadoop安装完后,启动时报Error: JAVA_HOME is not set and could not be found. 解决办法: 修改/etc/hadoop/hadoop-env.sh中设JAVA_HOME。
3864 0
Java - File 之 mkdir() & mkdirs() 区别
Java - File 之 mkdir() & mkdirs() 区别
43 0
could not open C:/program files/java/jre6/lib/i386/jvm.cfg 问题解决方法
验证JDK是否安装正确 输入 java -version  提示: could not open C:/program files/java/jre6/lib/i386/jvm.cfg   解决办法:                    标准JDK的lib目录下确实没有i386的目录,这个只在JRE中存在。
1074 0
hive 报system:java.io.tmpdir错误解决
Exception in thread "main" java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: ${system:java.
2294 0
WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platfo
安装 hadoop 2.4.1 报错信息 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform.
1362 0
Execute failed: java.io.IOException: Cannot run program "sdk-linux/build-tools/22.0.0/aapt": error=2
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/catoop/article/details/47157631 在Linux上使...
1151 0
+关注
biehl
爱生活,爱工作。
文章
问答
文章排行榜
最热
最新
相关电子书
更多
EXTENDING SPARK WITH JAVA AGENTS
立即下载
Build Your Next Apache Spark Job in .NET Using Mobius
立即下载
Java8简明教...[fredwong].1494561200.pdf
立即下载