{"record":{"id":"e4b66aeef40f4fba","repo":"stanfordnlp/CoreNLP","slug":"runtimeioexception-wrapping-ioexception-e4b66a","errorCode":null,"errorMessage":"RuntimeIOException wrapping IOException","messagePattern":"RuntimeIOException wrapping IOException","errorType":"exception","errorClass":"RuntimeIOException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/dcoref/CoNLL2011DocumentReader.java","lineNumber":137,"sourceCode":"      File curFile = fileList.get(curFileIndex);\n      if (docIterator == null) {\n        docIterator = new DocumentIterator(curFile.getAbsolutePath(), options);\n      }\n      while ( ! docIterator.hasNext()) {\n        logger.info(\"Processed \" + docIterator.docCnt + \" documents in \" + curFile.getAbsolutePath());\n        docIterator.close();\n        curFileIndex++;\n        if (curFileIndex >= fileList.size()) {\n          return null;  // DONE!\n        }\n        curFile = fileList.get(curFileIndex);\n        docIterator = new DocumentIterator(curFile.getAbsolutePath(), options);\n      }\n      Document next = docIterator.next();\n      SieveCoreferenceSystem.logger.fine(\"Reading document: \" + next.getDocumentID());\n      return next;\n    } catch (IOException ex) {\n      throw new RuntimeIOException(ex);\n    }\n  }\n\n  public void close()\n  {\n    IOUtils.closeIgnoringExceptions(docIterator);\n  }\n\n  public static class NamedEntityAnnotation implements CoreAnnotation<CoreMap> {\n    public Class<CoreMap> getType() {\n      return CoreMap.class;\n    }\n  }\n\n  public static class CorefMentionAnnotation implements CoreAnnotation<CoreMap> {\n    public Class<CoreMap> getType() {\n      return CoreMap.class;\n    }","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/dcoref/CoNLL2011DocumentReader.java#L119-L155","documentation":"CoNLL2011DocumentReader.getNextDocument reads the next CoNLL document and rethrows any IOException raised while reading/advancing the underlying DocumentIterator as an unchecked RuntimeIOException wrapping the original exception.","triggerScenarios":"IOException thrown by docIterator.next() or when constructing a new DocumentIterator for the next file — corrupt/missing CoNLL corpus file, unreadable path, or gzipped file problems.","commonSituations":"Corrupt CoNLL-2011/2012 corpus files, wrong file path in the corpus listing, truncated downloads of the CoNLL data, permission issues on the data directory.","solutions":["Inspect the wrapped IOException cause to find the failing file","Verify all files listed in the CoNLL corpus file list exist and are readable","Re-download/verify the CoNLL corpus archives (check integrity)","Fix file/directory permissions on the corpus path"],"exampleFix":"// before\nString path = \"/data/conll/train/missing_file.v4_gold_conll\";\n// after\nFile f = new File(path);\nif (!f.canRead()) throw new IllegalStateException(\"missing corpus file: \" + path);","handlingStrategy":"try-catch","validationCode":"for (String f : corpusFiles)\n  if (!new File(f).canRead()) throw new IllegalStateException(\"unreadable corpus file: \" + f);","typeGuard":null,"tryCatchPattern":"try {\n  Document d = reader.getNextDocument();\n} catch (RuntimeIOException e) {\n  logger.severe(\"CoNLL read failed: \" + e.getCause());\n  throw e;\n}","preventionTips":["Validate all corpus files are present and readable before training","Verify downloaded CoNLL archives for integrity","Inspect getCause() to identify the failing file"],"tags":["io","file-read","corpus","conll"],"backgroundTag":"file-read-failed","analyzedSha":"1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a","analyzedAt":"2026-09-10T02:24:07.274Z","contentChangedAt":"2026-09-10T02:24:07.274Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}