脚本宝典收集整理的这篇文章主要介绍了

记录使用nutch执行inject的时候遇到的第一个坑 java.lang.NullPointerException

脚本宝典小编觉得挺不错的,现在分享给大家,也给大家做个参考,希望能帮助你少写一行代码,多一份安全和惬意。

$ ./nutch inject urls InjectorJob: starting at 2016-11-08 11:20:12 InjectorJob: Injecting urlDir: urls InjectorJob: Using class org.apache.gora.mongodb.store.MongoStore as the Gora st      orage class. InjectorJob: java.lang.NullPointerException         at java.lang.ProcessBuilder.start(ProcessBuilder.java:1010)         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:      702)         at org.apache.hadoop.util.Shell.execCommand(Shell.java:791)         at org.apache.hadoop.util.Shell.execCommand(Shell.java:774)         at org.apache.hadoop.fs.RawLocalFileSystem.setPermission(RawLocalFileSys      tem.java:646)         at org.apache.hadoop.fs.RawLocalFileSystem.mkdirs(RawLocalFileSystem.jav      a:434)         at org.apache.hadoop.fs.FilterFileSystem.mkdirs(FilterFileSystem.java:28      1)         at org.apache.hadoop.mapreduce.JobSubmissionFiles.getStagingDir(JobSubmi      ssionFiles.java:125)         at org.apache.hadoop.mapreduce.JobSubmitter.submitJobInternal(JobSubmitt      er.java:348)         at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1285)         at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1282)         at java.security.AccessController.doPrivileged(Native Method)         at javax.security.auth.Subject.doAs(Subject.java:415)         at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInforma      tion.java:1614)         at org.apache.hadoop.mapreduce.Job.submit(Job.java:1282)         at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:1303)         at org.apache.nutch.util.NutchJob.waitForCompletion(NutchJob.java:115)         at org.apache.nutch.crawl.InjectorJob.run(InjectorJob.java:231)         at org.apache.nutch.crawl.InjectorJob.inject(InjectorJob.java:252)         at org.apache.nutch.crawl.InjectorJob.run(InjectorJob.java:275)         at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)         at org.apache.nutch.crawl.InjectorJob.main(InjectorJob.java:284) 

原因没有安装hadoop.

源码参见:hadoop-common-{version}.jar , Shell.java line 370 : winUtilsPath = getQualifiedBinPath("winutils.exe"); 调用链中:函数checkHadoopHome() 找不到hadoop安装目录引起的报NPE

总结

以上是脚本宝典为你收集整理的

记录使用nutch执行inject的时候遇到的第一个坑 java.lang.NullPointerException

全部内容,希望文章能够帮你解决

记录使用nutch执行inject的时候遇到的第一个坑 java.lang.NullPointerException

所遇到的程序开发问题,欢迎加入QQ群277859234一起讨论学习。如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典网站推荐给程序员好友。 本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。

80%的人都看过