[ 
https://issues.apache.org/jira/browse/NUTCH-2641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16641166#comment-16641166
 ] 

ASF GitHub Bot commented on NUTCH-2641:
---------------------------------------

sebastian-nagel closed pull request #380: Fix for NUTCH-2641 contributed by 
rustyx
URL: https://github.com/apache/nutch/pull/380
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/src/java/org/apache/nutch/webui/client/impl/RemoteCommand.java 
b/src/java/org/apache/nutch/webui/client/impl/RemoteCommand.java
index 107771a74..999dc4cf5 100644
--- a/src/java/org/apache/nutch/webui/client/impl/RemoteCommand.java
+++ b/src/java/org/apache/nutch/webui/client/impl/RemoteCommand.java
@@ -69,7 +69,7 @@ public void setTimeout(Duration timeout) {
   public String toString() {
     String statusInfo = StringUtils.EMPTY;
     if (jobInfo != null) {
-      statusInfo = new MessageFormat("{0}", 
Locale.ROOT).format(jobInfo.getState());
+      statusInfo = String.valueOf(jobInfo.getState());
     }
     return new MessageFormat("{0} status: {1}", Locale.ROOT).format(new 
Object[] {jobConfig.getType(), statusInfo});
   }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> ClassCastException in webui
> ---------------------------
>
>                 Key: NUTCH-2641
>                 URL: https://issues.apache.org/jira/browse/NUTCH-2641
>             Project: Nutch
>          Issue Type: Bug
>          Components: web gui
>    Affects Versions: 2.4, 1.15
>            Reporter: Rustam Abdullaev
>            Priority: Minor
>             Fix For: 2.4, 1.16
>
>
> webui 2.x constantly logs this exception whenever the status of a crawl 
> changes:
> {noformat}
> java.lang.ClassCastException: 
> org.apache.nutch.webui.client.model.JobInfo$State cannot be cast to 
> [Ljava.lang.Object;
> at java.text.MessageFormat.format(MessageFormat.java:865)
> at java.text.Format.format(Format.java:157)
> at 
> org.apache.nutch.webui.client.impl.RemoteCommand.toString(RemoteCommand.java:72)
> at 
> org.slf4j.helpers.MessageFormatter.safeObjectAppend(MessageFormatter.java:305)
> at 
> org.slf4j.helpers.MessageFormatter.deeplyAppendParameter(MessageFormatter.java:277)
> at org.slf4j.helpers.MessageFormatter.arrayFormat(MessageFormatter.java:231)
> at org.slf4j.helpers.MessageFormatter.format(MessageFormatter.java:124)
> at org.slf4j.impl.Log4jLoggerAdapter.info(Log4jLoggerAdapter.java:322)
> at 
> org.apache.nutch.webui.client.impl.CrawlingCycle.executeCrawlCycle(CrawlingCycle.java:63)
> at 
> org.apache.nutch.webui.service.impl.CrawlServiceImpl.startCrawl(CrawlServiceImpl.java:71)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at 
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
> at 
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
> at 
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
> at 
> org.springframework.aop.interceptor.AsyncExecutionInterceptor$1.call(AsyncExecutionInterceptor.java:97)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> at java.lang.Thread.run(Thread.java:748){noformat}
> The issue is in RemoteCommand, line 72. The arguments to 
> MessageFormat.format() should be in an array, even when there is only one.
> {code:java}
> statusInfo = new MessageFormat("{0}", Locale.ROOT).format(new Object[] 
> {jobInfo.getState()});
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to