{"record":{"id":"3e6c92a401179a36","repo":"stanfordnlp/CoreNLP","slug":"unknown-output-format-outputformat","errorCode":null,"errorMessage":"Unknown output format ${outputFormat}","messagePattern":"Unknown output format (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/pipeline/StanfordCoreNLP.java","lineNumber":101,"sourceCode":" * @author Steven Bethard\n */\n\npublic class StanfordCoreNLP extends AnnotationPipeline  {\n\n  public enum OutputFormat { TEXT, TAGGED, XML, JSON, CONLL, CONLLU, INLINEXML, SERIALIZED, CUSTOM }\n\n  private static String getDefaultExtension(OutputFormat outputFormat) {\n    switch (outputFormat) {\n      case XML: return \".xml\";\n      case JSON: return \".json\";\n      case CONLL: return \".conll\";\n      case CONLLU: return \".conllu\";\n      case TEXT: return \".out\";\n      case TAGGED: return \".tag\";\n      case INLINEXML: return \".inxml\";\n      case SERIALIZED: return \".ser.gz\";\n      case CUSTOM: return \".out\";\n      default: throw new IllegalArgumentException(\"Unknown output format \" + outputFormat);\n    }\n  }\n\n\n  /**\n   * An annotator name and its associated signature.\n   * Used in {@link #GLOBAL_ANNOTATOR_CACHE}.\n   */\n  public static class AnnotatorSignature {\n    public final String name;\n    public final String signature;\n\n    public AnnotatorSignature(String name, String signature) {\n      this.name = name;\n      this.signature = signature;\n    }\n\n    @Override","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/pipeline/StanfordCoreNLP.java#L83-L119","documentation":"StanfordCoreNLP.getDefaultExtension maps each OutputFormat enum (JSON, XML, CONLLU, TEXT, TAGGED, INLINEXML, SERIALIZED, CUSTOM) to a file extension; a value outside the known enum constants hits the default branch and throws IllegalArgumentException. In practice this means an unrecognized/unknown outputFormat value was supplied.","triggerScenarios":"Setting the 'outputFormat' property to an unsupported string so it fails to resolve to a known OutputFormat, or programmatically passing an OutputFormat value not handled by the switch after a library upgrade.","commonSituations":"Typo'd formats like outputFormat=txt (should be text) or outputFormat=yaml; using a format constant from a newer CoreNLP version with an older switch implementation.","solutions":["Use one of the supported outputFormat values: json, xml, text, tagged, conllu, inlinexml, serialized, or custom.","Correct the typo in the outputFormat property (e.g. outputFormat=text not txt).","Align CoreNLP jar versions between producer and consumer if a new OutputFormat constant is involved."],"exampleFix":"// before\nprops.setProperty(\"outputFormat\", \"txt\");\n// after\nprops.setProperty(\"outputFormat\", \"text\");","handlingStrategy":"validation","validationCode":"String fmt = props.getProperty(\"outputFormat\", \"json\").toLowerCase();\nList<String> allowed = Arrays.asList(\"json\",\"xml\",\"text\",\"tagged\",\"conllu\",\"inlinexml\",\"serialized\",\"custom\");\nif (!allowed.contains(fmt)) throw new IllegalArgumentException(\"Unsupported outputFormat: \" + fmt);","typeGuard":null,"tryCatchPattern":"try {\n  pipeline.processToOutputFile(...);\n} catch (IllegalArgumentException e) {\n  if (e.getMessage().startsWith(\"Unknown output format\")) {\n    props.setProperty(\"outputFormat\", \"json\"); // safe default\n  } else throw e;\n}","preventionTips":["Use only documented outputFormat values: json, xml, text, tagged, conllu, inlinexml, serialized, custom.","Lowercase the property value; don't invent formats like txt or yaml.","Keep the CoreNLP jar version consistent across services."],"tags":["corenlp","configuration","enum","output-format"],"backgroundTag":"invalid-enum-value","analyzedSha":"1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a","analyzedAt":"2026-09-10T02:24:07.274Z","contentChangedAt":"2026-09-10T02:24:07.274Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}