stanfordnlp/CoreNLP · error

Failure to load language specific properties:

Error message

Failure to load language specific properties: 

What it means

StanfordCoreNLPServer logs this when it fails to read the language-specific default properties file (e.g. Spanish, French) that it tries to merge into the request's properties. The IOException comes from opening/reading the language properties resource on the classpath. The server continues with the base properties, so requested language defaults (models, srparser.model, etc.) are silently missing and downstream annotators may fail to load.

Solutions

  1. Add the language-specific models jar (e.g. stanford-corenlp-4.x-models.jar or the per-language models jar) to the server's classpath.
  2. Verify the language code matches a supported language whose properties file exists under edu/stanford/nlp/pipeline/ (check with unzip -l on the jar).
  3. Log/inspect the wrapped IOException and languagePropertiesFile path to confirm whether the resource is absent or unreadable.
  4. If the language's defaults are truly unneeded, pass full explicit properties in the request so the language lookup path is not required.

Example fix

// before: server started with only core jar, request uses language=fr
java -cp stanford-corenlp.jar edu.stanford.nlp.pipeline.StanfordCoreNLPServer
// after: include language models
classpath=$(ls stanford-corenlp-*.jar):$(ls stanford-corenlp-*-models*.jar)
java -mx4g -cp "$classpath" edu.stanford.nlp.pipeline.StanfordCoreNLPServer -port 9000
Defensive patterns

Strategy: validation

Validate before calling

String lang = requestParams.getOrDefault("language", "en");
String res = "edu/stanford/nlp/pipeline/StanfordCoreNLP" + lang + ".properties";
if (getClass().getClassLoader().getResource(res) == null) {
    throw new IllegalStateException("Language properties not on classpath: " + res);
}

Prevention

When it happens

Trigger: Calling the server's / (or /tokens, etc.) endpoint with a language=xx parameter whose default properties file (StanfordCoreNLPServer default props for that language, e.g. StanfordCoreNLP.properties for Spanish) cannot be found or read in getProperties().

Common situations: Running the server jar without the models jar for the requested language on the classpath; typo in the language code (e.g. language=es-mx when only 'es' ships); custom CoreNLP distribution missing lang resources; fat-jar packaging that excluded language resource folders.

Understand the failure class

Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.

Related errors


AI-assisted analysis of stanfordnlp/CoreNLP@1b7edd19c4 (2026-09-10). Data as JSON: /api/errors/8af6ab70d31cd2fd. Report an issue: GitHub.

Appendix: source

Thrown at src/edu/stanford/nlp/pipeline/StanfordCoreNLPServer.java:538

      String languagePropertiesFile = LanguageInfo.getLanguagePropertiesFile(language);
      if (languagePropertiesFile != null) {
        try (BufferedReader is = IOUtils.readerFromString(languagePropertiesFile)){
          Properties languageSpecificProperties = new Properties();
          languageSpecificProperties.load(is);
          PropertiesUtils.overWriteProperties(props,languageSpecificProperties);
          // don't enforce requirements for non-English
          if ( ! LanguageInfo.HumanLanguage.ENGLISH.equals(LanguageInfo.getLanguageFromString(language))) {
            props.setProperty("enforceRequirements", "false");
          }
          // check if the server is set to use the srparser, and if so,
          // set the parse.model to be srparser.model
          // also, check properties for the srparser.model prop
          // perhaps some languages don't have a default set for that
          if (srparser && languageSpecificProperties.containsKey("srparser.model")) {
            props.setProperty("parse.model", languageSpecificProperties.getProperty("srparser.model"));
          }
        } catch (IOException e) {
          err("Failure to load language specific properties: " + languagePropertiesFile + " for " + language);
        }
      } else {
        try {
          respondError("Invalid language: '" + language + '\'', httpExchange);
        } catch (IOException e) { warn(e); }
        return new Properties();
      }
    }

    // (tweak the default properties a bit)
    if (!props.containsKey("mention.type")) {
      // Set coref head to use dependencies
      props.setProperty("mention.type", "dep");
      if (urlProperties.containsKey("annotators") && urlProperties.get("annotators") != null &&
          ArrayUtils.contains(urlProperties.get("annotators").split(","), "parse")) {
        // (case: the properties have a parse annotator --
        //        we don't have to use the dependency mention finder)
        props.remove("mention.type");

View on GitHub (pinned to 1b7edd19c4)