我想用Google新闻之类的Java开发应用程序。
为此,我从头开始,并与Nutch进行基本设置。
我已经完成安装,但是在一个命令中出现错误。
这里是关于技术的简要介绍。我在用
-nutch 1.11
-Cygwin
- My first command was :
$ bin/nutch
这给了我完美的输出。
- Then I did URI crawling like :
$ bin/nutch inject crawl/crawldb urls
哪个创建了crawldb文件夹并爬取给定的URL
- Now I want to generate segments and which gives me given Error :
$ bin/nutch generate crawl/crawldb crawl/segments
Generator: starting at 2016-04-14 17:30:29
Generator: Selecting best-scoring urls due for fetch.
Generator: filtering: true
Generator: normalizing: true
Generator: Partitioning selected urls for politeness.
Generator: segment: crawl/segments/20160414173032
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.hadoop.fs.FileStatus.isDirectory()Z
at org.apache.nutch.util.LockUtil.removeLockFile(LockUtil.java:79)
at org.apache.nutch.crawl.Generator.generate(Generator.java:637)
at org.apache.nutch.crawl.Generator.run(Generator.java:743)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
at org.apache.nutch.crawl.Generator.main(Generator.java:699)
我没有问题。 jar 之间是否有不匹配或有任何其他问题...。
最佳答案
您是自己制作坚果还是使用打包版本的?我刚刚 checkout 了Nutch repo的1.11分支并构建了它,执行您的命令将毫无异常(exception)地提供正确的输出。当然,我已经在不是Windows / cygwin的本地系统(OS X)上对此进行了测试,但这应该不是问题。
1.11nutch分支使用的是hadoop 2.4.0,您可以在runtime/local/lib/
文件夹中 check out 从Maven存储库中拉出的hadoop版本,并检查hadoop-*
文件。
关于hadoop - Nut 1.11错误:…org.apache.hadoop.fs.FileStatus.isDirectory()Z,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36625590/