java.lang.NullPointerException

JIRA | Gordon Mohr | 10 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    In 2.x test crawl, receiving thousands of local-to-a-processor alerts. Example: Oct 17, 2007 5:26:06 PM org.archive.modules.extractor.Extractor handleException WARNING: Exception (in thread 'ToeThread #51: http://www.sunlife.com.ph/Images/obanner.swf'; in processor 'ExtractorSWF') java.lang.NullPointerException at org.archive.modules.extractor.CrawlUriSWFAction.getURL(CrawlUriSWFAction.java:75) at com.anotherbigidea.flash.readers.ActionParser.processRecords(ActionParser.java:105) at com.anotherbigidea.flash.readers.ActionParser.parse(ActionParser.java:73) at com.anotherbigidea.flash.readers.TagParser.parseDoAction(TagParser.java:976) at com.anotherbigidea.flash.readers.TagParser.tag(TagParser.java:193) at org.archive.modules.extractor.ExtractorSWF$1.readOneTag(ExtractorSWF.java:127) at com.anotherbigidea.flash.readers.SWFReader.readTags(SWFReader.java:102) at com.anotherbigidea.flash.readers.SWFReader.readFile(SWFReader.java:92) at org.archive.modules.extractor.ExtractorSWF.innerExtract(ExtractorSWF.java:133) at org.archive.modules.extractor.ContentExtractor.extract(ContentExtractor.java:41) at org.archive.modules.extractor.Extractor.innerProcess(Extractor.java:80) at org.archive.modules.Processor.innerProcessResult(Processor.java:152) at org.archive.modules.Processor.process(Processor.java:118) at org.archive.crawler.framework.ToeThread.processCrawlUri(ToeThread.java:297) at org.archive.crawler.framework.ToeThread.run(ToeThread.java:152) Oct 17, 2007 5:26:25 PM org.archive.modules.extractor.Extractor handleException Besides the fact that CrawlUriSWFAction.getURL should probably handle a null more gracefully, that this exception can be caught (and is in fact reported) as a nonfatal error means it does not need to be a WARNING log event (and thus alert).

    JIRA | 10 years ago | Gordon Mohr
    java.lang.NullPointerException
  2. 0

    In 2.x test crawl, receiving thousands of local-to-a-processor alerts. Example: Oct 17, 2007 5:26:06 PM org.archive.modules.extractor.Extractor handleException WARNING: Exception (in thread 'ToeThread #51: http://www.sunlife.com.ph/Images/obanner.swf'; in processor 'ExtractorSWF') java.lang.NullPointerException at org.archive.modules.extractor.CrawlUriSWFAction.getURL(CrawlUriSWFAction.java:75) at com.anotherbigidea.flash.readers.ActionParser.processRecords(ActionParser.java:105) at com.anotherbigidea.flash.readers.ActionParser.parse(ActionParser.java:73) at com.anotherbigidea.flash.readers.TagParser.parseDoAction(TagParser.java:976) at com.anotherbigidea.flash.readers.TagParser.tag(TagParser.java:193) at org.archive.modules.extractor.ExtractorSWF$1.readOneTag(ExtractorSWF.java:127) at com.anotherbigidea.flash.readers.SWFReader.readTags(SWFReader.java:102) at com.anotherbigidea.flash.readers.SWFReader.readFile(SWFReader.java:92) at org.archive.modules.extractor.ExtractorSWF.innerExtract(ExtractorSWF.java:133) at org.archive.modules.extractor.ContentExtractor.extract(ContentExtractor.java:41) at org.archive.modules.extractor.Extractor.innerProcess(Extractor.java:80) at org.archive.modules.Processor.innerProcessResult(Processor.java:152) at org.archive.modules.Processor.process(Processor.java:118) at org.archive.crawler.framework.ToeThread.processCrawlUri(ToeThread.java:297) at org.archive.crawler.framework.ToeThread.run(ToeThread.java:152) Oct 17, 2007 5:26:25 PM org.archive.modules.extractor.Extractor handleException Besides the fact that CrawlUriSWFAction.getURL should probably handle a null more gracefully, that this exception can be caught (and is in fact reported) as a nonfatal error means it does not need to be a WARNING log event (and thus alert).

    JIRA | 10 years ago | Gordon Mohr
    java.lang.NullPointerException
  3. 0

    The following exception stack occurred when terminating a small test crawl via the web UI. A subsequent crawl terminated normally on same settings. com.sleepycat.util.RuntimeExceptionWrapper: (JE 3.2.23) Can't open a cursor Database state can't be DbState.CLOSED must be DbState.OPEN at com.sleepycat.collections.StoredContainer.convertException(StoredContainer.java:447) at com.sleepycat.collections.BlockIterator.hasNext(BlockIterator.java:380) at org.apache.commons.httpclient.cookie.CookieSpecBase.match(CookieSpecBase.java:607) at org.apache.commons.httpclient.HttpMethodBase.addCookieRequestHeader(HttpMethodBase.java:1193) at org.apache.commons.httpclient.HttpMethodBase.addRequestHeaders(HttpMethodBase.java:1327) at org.apache.commons.httpclient.HttpMethodBase.writeRequestHeaders(HttpMethodBase.java:2056) at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:1939) at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1000) at org.archive.httpclient.HttpRecorderGetMethod.execute(HttpRecorderGetMethod.java:116) at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:397) at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346) at org.archive.crawler.fetcher.FetchHTTP.innerProcess(FetchHTTP.java:500) at org.archive.crawler.framework.Processor.process(Processor.java:112) at org.archive.crawler.framework.ToeThread.processCrawlUri(ToeThread.java:302) at org.archive.crawler.framework.ToeThread.run(ToeThread.java:151) Caused by: com.sleepycat.je.DatabaseException: (JE 3.2.23) Can't open a cursor Database state can't be DbState.CLOSED must be DbState.OPEN at com.sleepycat.je.Database.checkRequiredDbState(Database.java:1069) at com.sleepycat.je.Database.openCursor(Database.java:359) at com.sleepycat.collections.CurrentTransaction.openCursor(CurrentTransaction.java:364) at com.sleepycat.collections.MyRangeCursor.openCursor(MyRangeCursor.java:53) at com.sleepycat.collections.MyRangeCursor.<init>(MyRangeCursor.java:30) at com.sleepycat.collections.DataCursor.init(DataCursor.java:171) at com.sleepycat.collections.DataCursor.<init>(DataCursor.java:59) at com.sleepycat.collections.BlockIterator.hasNext(BlockIterator.java:299) ... 15 more 07/05/2007 21:02:25 +0000 SEVERE org.archive.crawler.framework.ToeThread recoverableProblem Problem com.sleepycat.util.RuntimeExceptionWrapper: (JE 3.2.23) Can't open a cursor Database state can't be DbState.CLOSED must be DbState.OPEN occured when trying to process 'http://www.landsbokasafn.is/Apps/WebObjects/HI.woa/wa/header_logo_neg.gif' at step ABOUT_TO_BEGIN_PROCESSOR in HTTP com.sleepycat.util.RuntimeExceptionWrapper: (JE 3.2.23) Can't open a cursor Database state can't be DbState.CLOSED must be DbState.OPEN at com.sleepycat.collections.StoredContainer.convertException(StoredContainer.java:447) at com.sleepycat.collections.BlockIterator.hasNext(BlockIterator.java:380) at org.apache.commons.httpclient.cookie.CookieSpecBase.match(CookieSpecBase.java:607) at org.apache.commons.httpclient.HttpMethodBase.addCookieRequestHeader(HttpMethodBase.java:1193) at org.apache.commons.httpclient.HttpMethodBase.addRequestHeaders(HttpMethodBase.java:1327) at org.apache.commons.httpclient.HttpMethodBase.writeRequestHeaders(HttpMethodBase.java:2056) at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:1939) at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1000) at org.archive.httpclient.HttpRecorderGetMethod.execute(HttpRecorderGetMethod.java:116) at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:397) at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346) at org.archive.crawler.fetcher.FetchHTTP.innerProcess(FetchHTTP.java:500) at org.archive.crawler.framework.Processor.process(Processor.java:112) at org.archive.crawler.framework.ToeThread.processCrawlUri(ToeThread.java:302) at org.archive.crawler.framework.ToeThread.run(ToeThread.java:151) Caused by: com.sleepycat.je.DatabaseException: (JE 3.2.23) Can't open a cursor Database state can't be DbState.CLOSED must be DbState.OPEN at com.sleepycat.je.Database.checkRequiredDbState(Database.java:1069) at com.sleepycat.je.Database.openCursor(Database.java:359) at com.sleepycat.collections.CurrentTransaction.openCursor(CurrentTransaction.java:364) at com.sleepycat.collections.MyRangeCursor.openCursor(MyRangeCursor.java:53) at com.sleepycat.collections.MyRangeCursor.<init>(MyRangeCursor.java:30) at com.sleepycat.collections.DataCursor.init(DataCursor.java:171) at com.sleepycat.collections.DataCursor.<init>(DataCursor.java:59) at com.sleepycat.collections.BlockIterator.hasNext(BlockIterator.java:299) ... 15 more 07/05/2007 21:02:25 +0000 SEVERE org.archive.crawler.framework.ToeThread run Fatal exception in ToeThread #29: http://www.landsbokasafn.is/Apps/WebObjects/HI.woa/wa/header_logo_neg.gif java.lang.NullPointerException at org.archive.crawler.framework.ToeThread.run(ToeThread.java:157)

    JIRA | 10 years ago | Kristinn SigurĂ°sson
    java.lang.NullPointerException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    The following exception stack occurred when terminating a small test crawl via the web UI. A subsequent crawl terminated normally on same settings. com.sleepycat.util.RuntimeExceptionWrapper: (JE 3.2.23) Can't open a cursor Database state can't be DbState.CLOSED must be DbState.OPEN at com.sleepycat.collections.StoredContainer.convertException(StoredContainer.java:447) at com.sleepycat.collections.BlockIterator.hasNext(BlockIterator.java:380) at org.apache.commons.httpclient.cookie.CookieSpecBase.match(CookieSpecBase.java:607) at org.apache.commons.httpclient.HttpMethodBase.addCookieRequestHeader(HttpMethodBase.java:1193) at org.apache.commons.httpclient.HttpMethodBase.addRequestHeaders(HttpMethodBase.java:1327) at org.apache.commons.httpclient.HttpMethodBase.writeRequestHeaders(HttpMethodBase.java:2056) at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:1939) at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1000) at org.archive.httpclient.HttpRecorderGetMethod.execute(HttpRecorderGetMethod.java:116) at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:397) at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346) at org.archive.crawler.fetcher.FetchHTTP.innerProcess(FetchHTTP.java:500) at org.archive.crawler.framework.Processor.process(Processor.java:112) at org.archive.crawler.framework.ToeThread.processCrawlUri(ToeThread.java:302) at org.archive.crawler.framework.ToeThread.run(ToeThread.java:151) Caused by: com.sleepycat.je.DatabaseException: (JE 3.2.23) Can't open a cursor Database state can't be DbState.CLOSED must be DbState.OPEN at com.sleepycat.je.Database.checkRequiredDbState(Database.java:1069) at com.sleepycat.je.Database.openCursor(Database.java:359) at com.sleepycat.collections.CurrentTransaction.openCursor(CurrentTransaction.java:364) at com.sleepycat.collections.MyRangeCursor.openCursor(MyRangeCursor.java:53) at com.sleepycat.collections.MyRangeCursor.<init>(MyRangeCursor.java:30) at com.sleepycat.collections.DataCursor.init(DataCursor.java:171) at com.sleepycat.collections.DataCursor.<init>(DataCursor.java:59) at com.sleepycat.collections.BlockIterator.hasNext(BlockIterator.java:299) ... 15 more 07/05/2007 21:02:25 +0000 SEVERE org.archive.crawler.framework.ToeThread recoverableProblem Problem com.sleepycat.util.RuntimeExceptionWrapper: (JE 3.2.23) Can't open a cursor Database state can't be DbState.CLOSED must be DbState.OPEN occured when trying to process 'http://www.landsbokasafn.is/Apps/WebObjects/HI.woa/wa/header_logo_neg.gif' at step ABOUT_TO_BEGIN_PROCESSOR in HTTP com.sleepycat.util.RuntimeExceptionWrapper: (JE 3.2.23) Can't open a cursor Database state can't be DbState.CLOSED must be DbState.OPEN at com.sleepycat.collections.StoredContainer.convertException(StoredContainer.java:447) at com.sleepycat.collections.BlockIterator.hasNext(BlockIterator.java:380) at org.apache.commons.httpclient.cookie.CookieSpecBase.match(CookieSpecBase.java:607) at org.apache.commons.httpclient.HttpMethodBase.addCookieRequestHeader(HttpMethodBase.java:1193) at org.apache.commons.httpclient.HttpMethodBase.addRequestHeaders(HttpMethodBase.java:1327) at org.apache.commons.httpclient.HttpMethodBase.writeRequestHeaders(HttpMethodBase.java:2056) at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:1939) at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1000) at org.archive.httpclient.HttpRecorderGetMethod.execute(HttpRecorderGetMethod.java:116) at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:397) at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346) at org.archive.crawler.fetcher.FetchHTTP.innerProcess(FetchHTTP.java:500) at org.archive.crawler.framework.Processor.process(Processor.java:112) at org.archive.crawler.framework.ToeThread.processCrawlUri(ToeThread.java:302) at org.archive.crawler.framework.ToeThread.run(ToeThread.java:151) Caused by: com.sleepycat.je.DatabaseException: (JE 3.2.23) Can't open a cursor Database state can't be DbState.CLOSED must be DbState.OPEN at com.sleepycat.je.Database.checkRequiredDbState(Database.java:1069) at com.sleepycat.je.Database.openCursor(Database.java:359) at com.sleepycat.collections.CurrentTransaction.openCursor(CurrentTransaction.java:364) at com.sleepycat.collections.MyRangeCursor.openCursor(MyRangeCursor.java:53) at com.sleepycat.collections.MyRangeCursor.<init>(MyRangeCursor.java:30) at com.sleepycat.collections.DataCursor.init(DataCursor.java:171) at com.sleepycat.collections.DataCursor.<init>(DataCursor.java:59) at com.sleepycat.collections.BlockIterator.hasNext(BlockIterator.java:299) ... 15 more 07/05/2007 21:02:25 +0000 SEVERE org.archive.crawler.framework.ToeThread run Fatal exception in ToeThread #29: http://www.landsbokasafn.is/Apps/WebObjects/HI.woa/wa/header_logo_neg.gif java.lang.NullPointerException at org.archive.crawler.framework.ToeThread.run(ToeThread.java:157)

    JIRA | 10 years ago | Kristinn SigurĂ°sson
    java.lang.NullPointerException
  6. 0

    From Kris: It's me again :-) Discovered a potential NPE when terminating a job. The Frontier hangs around for the threads to finish (at least it is supposed too) but (as the following stacktrace shows), the CrawlController or more likely the CrawlScope (unsure which) does not: java.lang.NullPointerException at org.archive.crawler.postprocessor.Postselector.schedule(Postselector.java:2 69) at org.archive.crawler.postprocessor.Postselector.handleLinkCollection(Postsel ector.java:358) at org.archive.crawler.postprocessor.Postselector.innerProcess(Postselector.ja va:166) at org.archive.crawler.framework.Processor.process(Processor.java:102) at org.archive.crawler.framework.ToeThread.processCrawlUri(ToeThread.java:255) at org.archive.crawler.framework.ToeThread.run(ToeThread.java:131) Exception in thread "ToeThread #5" java.lang.NullPointerException at org.archive.crawler.framework.ToeThread.run(ToeThread.java:137) The following patch 'handles' it (if in a very simplistic way), basically just catcht the NPE, and decide that the URI is not within scope if this occurs. Maybe the CrawlController (and it should not be null) should throw an EndedException on getScope() when the crawl has been terminated? Not really a big bug, but we really should have the crawler finish at least semi-gracefully, although I should note that it did not prevent the crawl reports from being written. - Kris Index: Postselector.java =================================================================== RCS file: /cvsroot/archive-crawler/ArchiveOpenCrawler/src/java/org/archive/crawler/po stprocessor/Postselector.java,v retrieving revision 1.13 diff -u -r1.13 Postselector.java --- Postselector.java 27 Oct 2004 00:47:23 -0000 1.13 +++ Postselector.java 17 Nov 2004 15:45:25 -0000 @@ -266,21 +266,26 @@ * @return true if CandidateURI was accepted by crawl scope, false otherwise */ private boolean schedule(CandidateURI caUri) { - if(getController().getScope().accepts(caUri)) { - logger.finer("Accepted: "+caUri); - getController().getFrontier().schedule(caUri); - return true; - } else { - // Run the curi through another set of filters to see - // if we should log it to the scope rejection log. - if (logger.isLoggable(Level.INFO)) { - CrawlURI curi = (caUri instanceof CrawlURI)? - (CrawlURI)caUri: new CrawlURI(caUri.getUURI()); - if (filtersAccept(this.rejectLogFilters, curi)) { - logger.info("Rejected " + curi.getUURI().toString()); + try{ + if(getController().getScope().accepts(caUri)) { + logger.finer("Accepted: "+caUri); + getController().getFrontier().schedule(caUri); + return true; + } else { + // Run the curi through another set of filters to see + // if we should log it to the scope rejection log. + if (logger.isLoggable(Level.INFO)) { + CrawlURI curi = (caUri instanceof CrawlURI)? + (CrawlURI)caUri: new CrawlURI(caUri.getUURI()); + if (filtersAccept(this.rejectLogFilters, curi)) { + logger.info("Rejected " + curi.getUURI().toString()); + } } } + } catch(NullPointerException e){ + // Return false if this happens. Most likely the crawl is ending. } + return false; }

    JIRA | 1 decade ago | Michael Stack
    java.lang.NullPointerException

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at org.archive.modules.extractor.CrawlUriSWFAction.getURL()
    2. org.archive.modules
      CrawlUriSWFAction.getURL
      1. org.archive.modules.extractor.CrawlUriSWFAction.getURL(CrawlUriSWFAction.java:75)
      1 frame
    3. GWT incubator
      TagParser.tag
      1. com.anotherbigidea.flash.readers.ActionParser.processRecords(ActionParser.java:105)
      2. com.anotherbigidea.flash.readers.ActionParser.parse(ActionParser.java:73)
      3. com.anotherbigidea.flash.readers.TagParser.parseDoAction(TagParser.java:976)
      4. com.anotherbigidea.flash.readers.TagParser.tag(TagParser.java:193)
      4 frames
    4. org.archive.modules
      ExtractorSWF$1.readOneTag
      1. org.archive.modules.extractor.ExtractorSWF$1.readOneTag(ExtractorSWF.java:127)
      1 frame
    5. GWT incubator
      SWFReader.readFile
      1. com.anotherbigidea.flash.readers.SWFReader.readTags(SWFReader.java:102)
      2. com.anotherbigidea.flash.readers.SWFReader.readFile(SWFReader.java:92)
      2 frames
    6. org.archive.modules
      Processor.process
      1. org.archive.modules.extractor.ExtractorSWF.innerExtract(ExtractorSWF.java:133)
      2. org.archive.modules.extractor.ContentExtractor.extract(ContentExtractor.java:41)
      3. org.archive.modules.extractor.Extractor.innerProcess(Extractor.java:80)
      4. org.archive.modules.Processor.innerProcessResult(Processor.java:152)
      5. org.archive.modules.Processor.process(Processor.java:118)
      5 frames
    7. org.archive.crawler
      ToeThread.run
      1. org.archive.crawler.framework.ToeThread.processCrawlUri(ToeThread.java:297)
      2. org.archive.crawler.framework.ToeThread.run(ToeThread.java:152)
      2 frames