2007年3月12日
我在Run Nutch的时候出现这样的错误 -
08/07/07 04:05:41 INFO conf.Configuration: found resource crawl-urlfilter.txt at file:/home/hut/installfiles/nutch-0.9/out/production/nutch-0.9/crawl-urlfilter.txt
08/07/07 04:05:41 INFO conf.Configuration: found resource parse-plugins.xml at file:/home/hut/installfiles/nutch-0.9/out/production/nutch-0.9/parse-plugins.xml
08/07/07 04:05:41 INFO fetcher.Fetcher: fetching http://www.yale.edu/
08/07/07 04:05:41 INFO fetcher.Fetcher: fetching http://www.harvard.edu/
08/07/07 04:05:41 INFO fetcher.Fetcher: fetch of http://www.harvard.edu/ failed with: org.apache.nutch.protocol.ProtocolNotFound: protocol not found for url=http
08/07/07 04:05:41 INFO fetcher.Fetcher: fetch of http://www.yale.edu/ failed with: org.apache.nutch.protocol.ProtocolNotFound: protocol not found for url=http
解决方法:nutch-site.xml
<property>
<name>plugin.includes</name>
<value>
nutch-extensionpoints|protocol-http|urlfilter-regex|parse-(text|html|js)|index-basic|query-(basic|site|url)|summary-basic|scoring-opic|urlnormalizer-(pass|regex|basic)
</value>
<description>Regular expression naming plugin directory names to
include. Any plugin not matching this expression is excluded.
In any case you need at least include the nutch-extensionpoints plugin. By
default Nutch includes crawling just HTML and plain text via HTTP,
and basic indexing and search plugins. In order to use HTTPS please enable
protocol-httpclient, but be aware of possible intermittent problems with the
underlying commons-httpclient library.
</description>
</property>
nutch-extensionpoints|被我错误的删除了,还原以后一切工作正常. 默认情况下nutch0.9的目录结构中并没有plugin.includes这个properties, 它会载入nutch-default.xml里面的plugin.includes所以定义的所有的plugin. 在nutch-site.xml编辑/加入 plugin.includes properties的目的是为了加入我们自己的plugin而覆盖nutch-default.xml定义的.
posted @
2008-07-10 11:38 自己的小屋 阅读(2324) |
评论 (0) |
编辑 收藏
Nutch0.9 Crawl在Run的时候,有时候会出现 -
java.lang.ArrayIndexOutOfBoundsException: -1
at org.apache.lucene.index.MultiReader.isDeleted(MultiReader.java:113)
at org.apache.nutch.indexer.DeleteDuplicates$InputFormat$DDRecordReader.next(DeleteDuplicates.java:176)
at org.apache.hadoop.mapred.MapTask$1.next(MapTask.java:157)
at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:46)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:175)
at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:126)
Exception in thread "main" java.io.IOException: Job failed!
at org.apache.hadoop.mapred.JobClient.runJob(JobClient.java:604)
at org.apache.nutch.indexer.DeleteDuplicates.dedup(DeleteDuplicates.java:439)
at org.apache.nutch.crawl.Crawl.main(Crawl.java:135)
问题的解决方法:
https://issues.apache.org/jira/browse/NUTCH-525?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12515955
posted @
2008-07-10 11:32 自己的小屋 阅读(603) |
评论 (0) |
编辑 收藏
那是2007年三月二日,我发了<
定位Java类中的每个方法在类文件中的位置>引起了几个大虾的注意并且给我指点,当时看了以后也没有怎么弄,也不知道怎么弄.
这是cape给我的建议:
最直接的办法应该是分析class的bytecode,找到每个Method_info->Code Attribute->LineNumberTable Attribute今天空闲得慌而是我拿这个method linenumber几个keyword在网上狂搜了一把,
http://www.ibm.com/developerworks/cn/java/j-dyn0302/index.html
得到美文一篇,用Javassist来做. Javassist是一个专门操控java class的bytecode的类,可以动态的改变其状态,我没有深究它到底有多大的能耐,有兴趣可以去它的官方网站看看,
http://www.csg.is.titech.ac.jp/~chiba/javassist/但是它确实可以象cape指点的那样,让我实现对java类中的每个方法的定位(得到类中的某个方法的lineRange)
而是我就随便翻了几个例子以后根据在线文档写了不到100行代码轻松搞定。:) 我高兴啊。
干这个事情的两个java的source code可以从这里得到:
http://www.blogjava.net/Files/xmp123/MethodParser.zip
代码很简单,我就不解释代码了。
这是示例结果:
------------------------------------------------------------------------------------------------------------------------------
Analyzing net.blogjava.xmp123.MyMethodInfo ...
net.blogjava.xmp123.MyMethodInfo.getLineList() locate between 56 and 56
net.blogjava.xmp123.MyMethodInfo.updateLineList() locate between 63 and 80
net.blogjava.xmp123.MyMethodInfo.addLineToLineList(int) locate between 87 and 89
net.blogjava.xmp123.MyMethodInfo.setLineList(java.util.List) locate between 95 and 97
...
------------------------------------------------------------------------------------------------------------------------------
希望这东西有用......
posted @
2007-08-15 17:56 自己的小屋 阅读(1124) |
评论 (0) |
编辑 收藏
摘要:
阅读全文
posted @
2007-03-12 15:40 自己的小屋 阅读(2250) |
评论 (9) |
编辑 收藏