nutch安装配置运行时,一些常见的错误与解决方法

1、配置nutch资料分享:

分享一篇好的博客:http://blog.csdn.net/cailibiao/article/details/7577834

分享一段配置视频:http://www.tudou.com/programs/view/4aEaYZsdq0k

Nutch1.2 环境配置,经常回出现一些慕名奇妙的问题。网上也有很多的解释,但是内容太多太杂。而且每个人遇到的问题不同。 

下载Nutch文件:下面我把我遇上的问题及解答分享给大家。现在Nutch的官网上只有1.62.1的版本。如果下载其他的版本,我分享给大家一个连接:http://archive.apache.org/dist/nutch/

2、常见问题及我的解决方法

遇到:java.lang.RuntimeException: org.apache.nutch.net.URLFilter not found.

解决:这个错误的原因主要是nutch的根目录下缺少一个nutch.jar。因为压缩包中没有将nutch源代码编译。解决方法是:在eclipse工程目录根目录中找到build.xml。鼠标右击-->Run As-->Ant Build;这一部是将你下载下来的。

遇到:java.lang.RuntimeException: org.apache.nutch.plugin.

PluginRuntimeException:java.lang.ClassNotFoundException:org.apache.nutch.net.RegexURLFilterat org.apache.nutch.net.URLFilters.

解决:很多地方都是说把nutch-default.xmlplugin.foldersvalue改为./src/plugin。我试了很多次都没用。后来改为bulid/plugins就成功解决了这个问题。

遇到:No URLs to fetch - check your seed list and URL filters.

解决:网上很多说将crawl-urlfilter.txt中的+^http://([a-z0-9]*\.)*MY.DOMAIN.

NAME/改为+^http://([a-z0-9]*\.)*163.com(163.com只是其中的一种)。我是了不行,改为+^http://([a-z0-9]*\.)*后才有效。

遇到:http.agent.name Not exist

解决:在nutch.site.xml<configuration></configuration>中加入

<property>

  <name>http.agent.name</name>

  <value>Local</value>

  <description>HTTP 'User-Agent' request header. MUST NOT be empty - 

  please set this to a single word uniquely related to your organization.

  NOTE: You should also check other related properties:

http.robots.agents

http.agent.description

http.agent.url

http.agent.email

http.agent.version

  and set their values appropriately.

  </description>

</property>

<property>

  <name>http.agent.description</name>

  <value>Local web</value>

  <description>Further description of our bot- this text is used in

  the User-Agent header.  It appears in parenthesis after the agent name.

  </description>

</property>

<property>

  <name>http.agent.url</name>

  <value>http://MyCom.com</value>

  <description>A URL to advertise in the User-Agent header.  This will 

   appear in parenthesis after the agent name. Custom dictates that this

   should be a URL of a page explaining the purpose and behavior of this

   crawler.

  </description>

</property>

<property>

  <name>http.agent.email</name>

  <value>Your mail@ * .com</value>

  <description>An email address to advertise in the HTTP 'From' request

   header and User-Agent header. A good practice is to mangle this

   address (e.g. 'info at example dot com') to avoid spamming.

  </description>

</property>

以上是我参照网上信息配置nutch时,与网上部分说法有出入的步骤。如果你也遇到类似的情况,并且按照其他参考文档的说法无效时,不妨参考这里的内容。

还有就是一定要坚持,我配了3天,你呢?

 

分享一下胜利果实:

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值