java.lang.NullPointerExceptionjava.lang.NullPointerException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Below is back and forth between Igor and Stack on an NPE found by Igor serializing out cookies. Looks like we came a cross a cookie that had a null value. No need for the patch. It is not critical to anything that we are doing. i. > Probably not a regression. I think ye've just found case where a cookie value comes back null, something we've not come across before. Doing an append with null to MutableString throws NPE: > > > > [bregeon] ~ > bsh -classpath ~/workspace/heritrix/lib/dsi.unimi.it-1.2.0.jar BeanShell 2.0b4 - by Pat Niemeyer (pat@pat.net) > bsh % new it.unimi.dsi.mg4j.util.MutableString(); > bsh % ms = new it.unimi.dsi.mg4j.util.MutableString(); > bsh % ms.append(null); > // Error: // Uncaught Exception: Method Invocation ms.append : at Line: 3 : in file: <unknown file> : ms .append ( null ) Target exception: java.lang.NullPointerExceptionjava.lang.NullPointerException > at it.unimi.dsi.mg4j.util.MutableString.append(MutableString.java:811) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:3 9) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp l.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at bsh.Reflect.invokeMethod(Unknown Source) > at bsh.Reflect.invokeObjectMethod(Unknown Source) > at bsh.Name.invokeMethod(Unknown Source) > at bsh.BSHMethodInvocation.eval(Unknown Source) > at bsh.BSHPrimaryExpression.eval(Unknown Source) > at bsh.BSHPrimaryExpression.eval(Unknown Source) > at bsh.Interpreter.run(Unknown Source) > at bsh.Interpreter.main(Unknown Source) > > > I'm guessing the problematic value just didn't make it into the cookie.dump. > > Want me to add patch for the NPE? > > St.Ack > > > Igor Ranitovic wrote: >> Hi Stack, >> >> In our latest IQ crawl we used save-cookies option. We have not done this in long time and it seems that we found a regression or new bug. >> At the end of the crawl, Mike notice that reports are not being generated hours after the termination. Looking at heritrix_out revealed the NPE within the Ubicrawler mutable string: >> Exception in thread "ToeThread #61: " java.lang.NullPointerException >> at it.unimi.dsi.mg4j.util.MutableString.append(MutableString.java:828) >> at org.archive.crawler.fetcher.FetchHTTP.saveCookies(FetchHTTP.java:1278) >> at org.archive.crawler.fetcher.FetchHTTP.saveCookies(FetchHTTP.java:1231) >> at org.archive.crawler.fetcher.FetchHTTP.finalTasks(FetchHTTP.java:963) >> at org.archive.crawler.framework.CrawlController.runProcessorFinalTasks(CrawlC ontroller.java:1669) >> at org.archive.crawler.framework.CrawlController.completeStop(CrawlController. java:1026) >> at org.archive.crawler.admin.CrawlJob$MBeanCrawlController.completeStop(CrawlJ ob.java:793) >> at org.archive.crawler.framework.CrawlController.toeEnded(CrawlController.java :1810) >> at org.archive.crawler.framework.ToeThread.run(ToeThread.java:190) >> Exception in thread "StatLogger" java.lang.NullPointerException >> at org.archive.crawler.admin.CrawlJob$MBeanCrawlController.progressStatisticsE vent(CrawlJob.java:763) >> at org.archive.crawler.framework.AbstractTracker.progressStatisticsEvent(Abstr actTracker.java:185) >> at org.archive.crawler.admin.StatisticsTracker.progressStatisticsEvent(Statist icsTracker.java:303) >> at org.archive.crawler.framework.AbstractTracker.run(AbstractTracker.java:142) >> at java.lang.Thread.run(Thread.java:595) >> >> >> We did get some of the cookies dumped to the disk. See cookies.dump and the rest of the >> configuration files are at crawling004:/0/loc-jobs/IQ-100/ >> >> i. >
    via by Michael Stack,
    • java.lang.NullPointerExceptionjava.lang.NullPointerException at it.unimi.dsi.mg4j.util.MutableString.append(MutableString.java:811) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at bsh.Reflect.invokeMethod(Unknown Source) at bsh.Reflect.invokeObjectMethod(Unknown Source) at bsh.Name.invokeMethod(Unknown Source) at bsh.BSHMethodInvocation.eval(Unknown Source) at bsh.BSHPrimaryExpression.eval(Unknown Source) at bsh.BSHPrimaryExpression.eval(Unknown Source) at bsh.Interpreter.run(Unknown Source) at bsh.Interpreter.main(Unknown Source)
    No Bugmate found.