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

來源:互聯網
上載者:User

標籤:alt   apach   ecc   log   cal   call   shel   nbsp   images   

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

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

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.