本文介绍了Nutch 'http.agent.name' 中没有列出代理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Exception in thread "main" java.lang.IllegalArgumentException: Fetcher: No agents listed in 'http.agent.name' property.
        at org.apache.nutch.fetcher.Fetcher.checkConfiguration(Fetcher.java:1166)
        at org.apache.nutch.fetcher.Fetcher.fetch(Fetcher.java:1068)
        at org.apache.nutch.crawl.Crawl.run(Crawl.java:135)
        at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
        at org.apache.nutch.crawl.Crawl.main(Crawl.java:54)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:156)

每次我运行 ./nutch crawl urls -dir crawl -depth 3 -topN 5 .nutch 决定抛出这个错误.我有我的 nutch-site.xml &nutch-default.xml 设置.

Every time i run ./nutch crawl urls -dir crawl -depth 3 -topN 5 . nutch decides to throw this error. I have both my nutch-site.xml & nutch-default.xml set with.

 <property>
  <name>http.agent.name</name>
  <value>blah</value>
  </property>

去掉描述以使其更易于阅读.但是我看不到可以指定代理名称的其他位置.如果有人有任何建议,我将不胜感激.

Took the description out to make its easier to read. But I fail to see where else the agent name can be specified. if anybody has any advice I would be grateful.

推荐答案

使用 1.3?如果是这样,请确保您在 runtime/local/conf 中更改了 nutch-site.xml(而不是默认值)除非您使用 ant 重建,否则更改 NUTCH_HOME/conf 中的 conf 不会复制到运行时目录.

using 1.3? If so make sure you changed nutch-site.xml (and not default) in runtime/local/confChanging the conf in NUTCH_HOME/conf won't be copied to the runtime dirs unless you rebuild with ant.

这篇关于Nutch 'http.agent.name' 中没有列出代理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 12:28