---
title: "Nutch1.0导入eclipse错误解决"
author: "yanglingstu"
date: "2010-03-25T16:05:03Z"
tags: []
categories: ["编程语言"]
slug: "nutch1-0-eclipse"
draft: false
lastmod: "2010-03-26T19:16:44Z"
id: 624623
url: "https://yztech.iteye.com/blog/624623"
---

Nutch1.0导入eclipse工程后，一般的工程都会有两个错误，nutch的official 1.0 release版本中，这两个问题因为licensing issues没有修复。接下来的就是最关键的部分了。
修改----  src\plugin\parse-rtf\src\java\org\apache\nutch\parse\rtf下 RTFParseFactory.java
添加----- import org.apache.nutch.parse.ParseResult;
将  ----- public Parse getParse(Content content) {
改为---- public ParseResult getParse(Content content) {
将  ---- return new ParseStatus(ParseStatus.FAILED,
                               ParseStatus.FAILED_EXCEPTION,
                               e.toString()).getEmptyParse(conf);
改为-----return new ParseStatus(ParseStatus.FAILED,
                ParseStatus.FAILED_EXCEPTION,
              e.toString()).getEmptyParseResult(content.getUrl(), getConf());
将------return new ParseImpl(text,
                         new ParseData(ParseStatus.STATUS_SUCCESS,
                                       title,
                                       OutlinkExtractor.getOutlinks(text, this.conf),
                                       content.getMetadata(),
                                       metadata));
改为------return ParseResult.createParseResult(content.getUrl(),
                             new ParseImpl(text,
                                     new ParseData(ParseStatus.STATUS_SUCCESS,
                                             title,
                                             OutlinkExtractor.getOutlinks(text, this.conf),
                                             content.getMetadata(),
                                             metadata)));

修改------src\plugin\parse-rtf\src\test\org\apache\nutch\parse\rtf下的 TestRTFParser.java
将-----parse = new ParseUtil(conf).parseByExtensionId("parse-rtf", content);
改为----parse = new ParseUtil(conf).parseByExtensionId("parse-rtf", content).get(urlString);
到这一步，eclipse上面的工程就会没有错误了 .