Hi Lewis,

Thanks for replying, I will try and open a ticket after I'm sure its a Nutch "bug" and not something that I've overlooked (don't want to create noise). Looking at the source I think it was caused by the following line:

topN = (Long) args.get(Nutch.ARG_TOPN);

I managed to get it temporarily "fixed" by replacing the above with the following:

try{

  topN = (Long) args.get(Nutch.ARG_TOPN);
} catch(Exception e) {

  topN = Long.parseLong(args.get(Nutch.ARG_TOPN).toString());
  LOG.warn("Error: " + e + "test: " + args.get(Nutch.ARG_TOPN));
}

I guess it complains about ClassCastException because JSON stores the argument as int or string and not long.

Regards,
Alex

Quoting Lewis John Mcgibbney <[email protected]>:

Hi Alex,

On Thu, May 7, 2015 at 11:44 AM, <[email protected]> wrote:


Hi All,

I'm getting "java.lang.ClassCastException: java.lang.Integer cannot be
cast to java.lang.Long" when sending topN argument for /job/create using
Nutch 2.x RESTApi. Does any1 knows how to fix that? Thanks.


Can you please open a ticket in Jira and submit your stacktrace including
your environment so we can reproduce?
We can get a fix sorted out for the next 2.X release.
Thanks
Lewis



Reply via email to