Nutch1.0导入eclipse错误解决

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上面的工程就会没有错误了 .

你可能感兴趣的:(apache,eclipse)