[
https://issues.apache.org/jira/browse/NUTCH-1188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13141240#comment-13141240
]
Lewis John McGibbney commented on NUTCH-1188:
---------------------------------------------
Thank you for this patch. In the short term, when we get one other +1, I would
like to commit. Can I ask you to have a look @ NUTCH-1138 and comment on
whether the patch is any use for your activities. It is our vision to remove
LogUtil and use the Slf4j/Log4j framework for all logging.
Thank you very much for this patch.
> ERROR util.LogUtil - Cannot log with method [null]
> --------------------------------------------------
>
> Key: NUTCH-1188
> URL: https://issues.apache.org/jira/browse/NUTCH-1188
> Project: Nutch
> Issue Type: Bug
> Components: fetcher
> Affects Versions: 1.4
> Environment: no special enviroment
> Reporter: Zhang JinYan
> Attachments: LogUtil.patch
>
>
> LogUtil has static fields,which is initialized like this:
> FATAL = Logger.class.getMethod("error", new Class[] { Object.class });
> but the Logger has no such method,the correct method is:
> void org.slf4j.Logger.error(String msg)
> So,LogUtil's static fields are not initialized correctly(they are null)
> -------------------------------
> Run crawl,you will find msg in hadoop.log:
> 2011-11-01 22:38:14,442 ERROR util.LogUtil - Cannot log with method [null]
> java.lang.NullPointerException
> at org.apache.nutch.util.LogUtil$1.flush(LogUtil.java:103)
> at java.io.PrintStream.write(PrintStream.java:432)
> at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:202)
> at sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:272)
> at sun.nio.cs.StreamEncoder.flushBuffer(StreamEncoder.java:85)
> at java.io.OutputStreamWriter.flushBuffer(OutputStreamWriter.java:168)
> at java.io.PrintStream.newLine(PrintStream.java:496)
> at java.io.PrintStream.println(PrintStream.java:757)
> at java.lang.Throwable.printStackTraceAsCause(Throwable.java:492)
> at java.lang.Throwable.printStackTrace(Throwable.java:468)
> at
> org.apache.nutch.protocol.http.api.HttpBase.getProtocolOutput(HttpBase.java:197)
> at org.apache.nutch.fetcher.Fetcher$FetcherThread.run(Fetcher.java:665)
> ----------------------------
> Patch:
> FATAL = Logger.class.getMethod("error", new Class[] { String.class });
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira