java.lang.NullPointerException at java.lang.ProcessBuilder.start(Unknown Source) at org.apache.hadoop.util.Shell.runCommand(Shell.java:482)

1:问题出现的原因,部署好的hadoop-2.6.4进行window10操作hadoop api出现的错误,具体错误是我向hdfs上传文件,还好点,之前解决过,这里不叙述,这里说一下从hdfs下载文件出现的错误:

详细错误如下所示:

java.lang.NullPointerException
    at java.lang.ProcessBuilder.start(Unknown Source)
    at org.apache.hadoop.util.Shell.runCommand(Shell.java:482)
    at org.apache.hadoop.util.Shell.run(Shell.java:455)
    at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:715)
    at org.apache.hadoop.util.Shell.execCommand(Shell.java:808)
    at org.apache.hadoop.util.Shell.execCommand(Shell.java:791)
    at org.apache.hadoop.fs.RawLocalFileSystem.setPermission(RawLocalFileSystem.java:659)
    at org.apache.hadoop.fs.FilterFileSystem.setPermission(FilterFileSystem.java:490)
    at org.apache.hadoop.fs.ChecksumFileSystem.create(ChecksumFileSystem.java:462)
    at org.apache.hadoop.fs.ChecksumFileSystem.create(ChecksumFileSystem.java:428)
    at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:908)
    at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:889)
    at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:786)
    at org.apache.hadoop.fs.FileUtil.copy(FileUtil.java:365)
    at org.apache.hadoop.fs.FileUtil.copy(FileUtil.java:338)
    at org.apache.hadoop.fs.FileUtil.copy(FileUtil.java:289)
    at org.apache.hadoop.fs.FileSystem.copyToLocalFile(FileSystem.java:1970)
    at org.apache.hadoop.fs.FileSystem.copyToLocalFile(FileSystem.java:1939)
    at org.apache.hadoop.fs.FileSystem.copyToLocalFile(FileSystem.java:1915)
    at com.bie.lesson01.HdfsClientTest.downloadFile(HdfsClientTest.java:64)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

确实如很多网友说的:
出现原因:缺少hadoop.dll或winutils.exe

解决办法:缺少哪个,就在本地的E:\hadoop\hadoop-2.6.4\bin下加上哪个。
而这个方法,貌似不好使,经过亲自测试,解决方法如下所示:

在你的bin目录里面加上这两个文件,然后呢,在你的C:\Windows\System32加上hadoop.dll就可以解决上面出现的错误。

而且可以完成你想要完成的操作:

资源下载地址:http://download.csdn.net/download/biexiansheng/10132712

 停更......

2017-11-25 17:28:05

时间: 2024-09-21 12:15:06

java.lang.NullPointerException at java.lang.ProcessBuilder.start(Unknown Source) at org.apache.hadoop.util.Shell.runCommand(Shell.java:482)的相关文章

java 图片加载-input == null! atImageIO.read(Unknown Source)

问题描述 input == null! atImageIO.read(Unknown Source) import java.awt.Graphics; import java.awt.Image; import java.awt.image.BufferedImage; import java.io.IOException; import java.net.URL; import javax.swing.JFrame; public class PhotoTest extends JFrame

Exceptionin thread "main" java.lang.UnsatisfiedLinkError:org.apache.hadoop.util.NativeCrc32.nativeComputeChunkedSumsByteArray(II[BI[BIILjava

这是由于hadoop.dll 版本问题,2.4之前的和自后的需要的不一样     需要选择正确的版本并且在 Hadoop/bin和 C:\windows\system32 上将其替换

mybatis-myBatis中的莫名其妙的java.lang.NullPointerException,求指教

问题描述 myBatis中的莫名其妙的java.lang.NullPointerException,求指教 xml: <!-- ognl访问静态方法的表达式 为@class@method(args),以下为调用Ognl.isNotEmpty()方法,还有其它方法如isNotBlank()可以使用,具体请查看Ognl类 --> AND SRLNO = '${h_srlno}' AND URGEDATE = '${h_date}' </where> </sql> <s

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.4.1/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class] 3 SLF4J:

ndroid-新人求助 java.lang.NullPointerException

问题描述 新人求助 java.lang.NullPointerException 04-26 21:42:40.039: E/AndroidRuntime(1125): FATAL EXCEPTION: main 04-26 21:42:40.039: E/AndroidRuntime(1125): Process: com.example.remotecontrol, PID: 1125 04-26 21:42:40.039: E/AndroidRuntime(1125): java.lang

servlet-关于java.lang.NullPointerException的问题

问题描述 关于java.lang.NullPointerException的问题 提示的错误是:严重: Servlet.service() for servlet Shopping threw exceptionjava.lang.NullPointerException at cn.itcast.Shopping.doGet(Shopping.java:45) at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) at

axis-AxisFault 错误 java.lang.NullPointerException

问题描述 AxisFault 错误 java.lang.NullPointerException 报错行是UserInfo userinfo = (UserInfo) call.invoke(new Object[] {sid,sysno,ip }); AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException faultSubcode: faultString: java.lang.N

Hadoop MapReduce示例程序WordCount.java手动编译运行解析

WordCount.java vi WordCount.java import java.io.IOException; import java.util.StringTokenizer; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.IntWritable; import org.apache.hadoop.io.Text; i

JsonMappingException: (was java.lang.NullPointerException)

使用jackson 序列化Java对象的时候报异常: Java代码   com.fasterxml.jackson.databind.JsonMappingException: (was java.lang.NullPointerException) (through reference chain: com.chanjet.gov.Student["age"])       at com.fasterxml.jackson.databind.JsonMappingException.