languagetool-org/languagetool · error · IllegalArgumentException

beolingusFile not found:

Error message

beolingusFile not found: 

What it means

The 'beolingusFile' property points to a local file of Beolingus translations used to improve multilingual lookup. If the path does not exist on disk, HTTPServerConfig throws this IllegalArgumentException instead of silently starting without the data.

Source

Thrown at languagetool-server/src/main/java/org/languagetool/server/HTTPServerConfig.java:489

        }
        dictLimitUser = Integer.valueOf(getOptionalProperty(props, "dictLimitUser", "0"));
        dictLimitTeam = Integer.valueOf(getOptionalProperty(props, "dictLimitTeam", "0"));
        styleGuideLimitUser = Integer.valueOf(getOptionalProperty(props, "styleGuideLimitUser", "0"));
        styleGuideLimitTeam = Integer.valueOf(getOptionalProperty(props, "styleGuideLimitTeam", "0"));
        requestLimitAccessToken = getOptionalProperty(props, "requestLimitAccessToken", null);
        jwtSecret = getOptionalProperty(props, "jwtSecret", null);
        externalRolloutServiceUrl = getOptionalProperty(props, "externalRolloutServiceUrl", null);
        externalRolloutServiceApiKey = getOptionalProperty(props, "externalRolloutServiceApiKey", null);

        globalConfig.setGrammalecteServer(getOptionalProperty(props, "grammalecteServer", null));
        globalConfig.setGrammalecteUser(getOptionalProperty(props, "grammalecteUser", null));
        globalConfig.setGrammalectePassword(getOptionalProperty(props, "grammalectePassword", null));
        String beolingusFile = getOptionalProperty(props, "beolingusFile", null);
        if (beolingusFile != null) {
          if (new File(beolingusFile).exists()) {
            globalConfig.setBeolingusFile(new File(beolingusFile));
          } else {
            throw new IllegalArgumentException("beolingusFile not found: " + beolingusFile);
          }
        }
        String nerUrl = getOptionalProperty(props, "nerUrl", null);
        if (nerUrl != null) {
          globalConfig.setNERUrl(nerUrl);
          logger.info("Using NER service: " + globalConfig.getNerUrl());
        }
        for (Object o : props.keySet()) {
          String key = (String)o;
          if (!KNOWN_OPTION_KEYS.contains(key) && !key.matches("lang-[a-z]+-dictPath") && !key.matches("lang-[a-z]+")) {
            System.err.println("***** WARNING: ****");
            System.err.println("Key '" + key + "' from configuration file '" + file + "' is unknown. Please check the key's spelling (case is significant).");
            System.err.println("Known keys: " + KNOWN_OPTION_KEYS);
          }
        }

        addDynamicLanguages(props);
        setAbTest(getOptionalProperty(props, "abTest", null));

View on GitHub (pinned to 2e990059ce)

Solutions

  1. Download/obtain the Beolingus file and point 'beolingusFile' at an absolute, existing path
  2. Verify existence with 'ls -l <path>' before starting the server
  3. Remove the 'beolingusFile' property if the file is not required

Example fix

// before (server.properties)
beolingusFile=./data/de-en.txt

// after (server.properties)
beolingusFile=/opt/languagetool/data/de-en.txt
Defensive patterns

Strategy: validation

Validate before calling

String p = props.getProperty("beolingusFile");
if (p != null && !new File(p).exists()) {
    throw new IllegalStateException("beolingusFile does not exist: " + p);
}

Try / catch

try {
    serverConfig = new HTTPServerConfig(props);
} catch (IllegalArgumentException e) {
    if (e.getMessage().startsWith("beolingusFile not found")) {
        log.error("Beolingus data file missing: {}", e.getMessage());
    }
    throw e;
}

Prevention

When it happens

Trigger: Server properties contains 'beolingusFile=/path' where the file does not exist (typo, missing download, wrong mount path).

Common situations: Beolingus data file never downloaded onto the server; Docker image built without copying the file; relative path resolved against an unexpected working directory.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


AI-assisted analysis of languagetool-org/languagetool@2e990059ce (2026-09-06). Data as JSON: /api/errors/d36a23f4a95f0a6e. Report an issue: GitHub.