{"record":{"id":"2048ecf026c2c819","repo":"stanfordnlp/CoreNLP","slug":"both-parse-model-and-parse-executable-properties-m","errorCode":null,"errorMessage":"Both parse.model and parse.executable properties must be specified if parse.type=charniak","messagePattern":"Both parse\\.model and parse\\.executable properties must be specified if parse\\.type=charniak","errorType":"validation","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/pipeline/AnnotatorImplementations.java","lineNumber":140,"sourceCode":"  }\n\n  /**\n   * Annotate parse trees\n   *\n   * @param properties Properties that control the behavior of the parser. It use \"parse.x\" properties.\n   * @return A ParserAnnotator\n   */\n  public Annotator parse(Properties properties) {\n    String parserType = properties.getProperty(\"parse.type\", \"stanford\");\n    String maxLenStr = properties.getProperty(\"parse.maxlen\");\n\n    if (parserType.equalsIgnoreCase(\"stanford\")) {\n      return new ParserAnnotator(\"parse\", properties);\n    } else if (parserType.equalsIgnoreCase(\"charniak\")) {\n      String model = properties.getProperty(\"parse.model\");\n      String parserExecutable = properties.getProperty(\"parse.executable\");\n      if (model == null || parserExecutable == null) {\n        throw new RuntimeException(\"Both parse.model and parse.executable properties must be specified if parse.type=charniak\");\n      }\n      int maxLen = 399;\n      if (maxLenStr != null) {\n        maxLen = Integer.parseInt(maxLenStr);\n      }\n\n      return new CharniakParserAnnotator(model, parserExecutable, false, maxLen);\n    } else {\n      throw new RuntimeException(\"Unknown parser type: \" + parserType + \" (currently supported: stanford and charniak)\");\n    }\n  }\n\n  public Annotator custom(Properties properties, String property) {\n    String customName = property;\n    String customClassName = properties.getProperty(StanfordCoreNLP.CUSTOM_ANNOTATOR_PREFIX + property);\n    if (property.startsWith(StanfordCoreNLP.CUSTOM_ANNOTATOR_PREFIX)) {\n      customName = property.substring(StanfordCoreNLP.CUSTOM_ANNOTATOR_PREFIX.length());\n      customClassName = properties.getProperty(property);","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/pipeline/AnnotatorImplementations.java#L122-L158","documentation":"AnnotatorImplementations.parse() supports 'stanford' and 'charniak' parser types; choosing parse.type=charniak requires both the path to the Charniak parser model and the path to its executable via properties. If either is missing it throws RuntimeException at pipeline setup time.","triggerScenarios":"Configuring CoreNLP with parse.type=charniak while omitting parse.model or parse.executable (or misspelling either key).","commonSituations":"Copying Stanford-parser configs and switching type to charniak without adding the required keys, typo like parse.model_path, running on a machine where the Charniak binary path was never configured.","solutions":["Set both properties: -parse.model /path/to/model and -parse.executable /path/to/bparser (or parse.model=..., parse.executable=... in a properties file)","Verify exact key spellings: parse.model and parse.executable","If you do not have the Charniak parser, remove parse.type or set parse.type=stanford to use the built-in Stanford parser","Check for whitespace/null values in the properties file (empty value still fails the null check is avoided but binary must exist)"],"exampleFix":"// before\nprops.setProperty(\"parse.type\", \"charniak\");\n// after\nprops.setProperty(\"parse.type\", \"charniak\");\nprops.setProperty(\"parse.model\", \"/path/to/charniak/model\");\nprops.setProperty(\"parse.executable\", \"/path/to/bparser\");","handlingStrategy":"validation","validationCode":"Properties p = props;\nif (\"charniak\".equalsIgnoreCase(p.getProperty(\"parse.type\", \"stanford\"))) {\n  if (p.getProperty(\"parse.model\") == null || p.getProperty(\"parse.executable\") == null)\n    throw new IllegalArgumentException(\"parse.model and parse.executable required for charniak\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  buildPipeline(props);\n} catch (RuntimeException e) {\n  if (e.getMessage().contains(\"parse.type=charniak\")) {\n    log.error(\"Add -parse.model and -parse.executable to your config\");\n  } else throw e;\n}","preventionTips":["Always set both keys when using charniak","Double-check exact key spellings","Use parse.type=stanford if Charniak isn't installed","Keep executable path in a checked-in properties template"],"tags":["configuration","corenlp","parser","java"],"backgroundTag":"missing-required-config-field","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"}