languagetool-org/languagetool · error · IllegalArgumentException

Invalid value for textCheckerQueueSize, must be >= 1:

Error message

Invalid value for textCheckerQueueSize, must be >= 1: 

What it means

Configuration validation in HTTPServerConfig: the textCheckerQueueSize property parsed from server properties is < 1, which would allow no queue at all for text checking.

Source

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

          setLanguageModelDirectory(langModel);
        }
        String fasttextModel = getOptionalProperty(props, "fasttextModel", null);
        String fasttextBinary = getOptionalProperty(props, "fasttextBinary", null);
        if (fasttextBinary != null && fasttextModel != null) {
          setFasttextPaths(fasttextModel, fasttextBinary);
        }
        maxCheckThreads = Integer.parseInt(getOptionalProperty(props, "maxCheckThreads", "10"));
        if (maxCheckThreads < 1) {
          throw new IllegalArgumentException("Invalid value for maxCheckThreads, must be >= 1: " + maxCheckThreads);
        }
        // default value 0 = use maxCheckThreads setting (for compatibility)
        maxTextCheckerThreads = Integer.parseInt(getOptionalProperty(props, "maxTextCheckerThreads", "0"));
        if (maxTextCheckerThreads < 0) {
          throw new IllegalArgumentException("Invalid value for maxTextCheckerThreads, must be >= 1: " + maxTextCheckerThreads);
        }
        textCheckerQueueSize = Integer.parseInt(getOptionalProperty(props, "textCheckerQueueSize", "8"));
        if (textCheckerQueueSize < 0) {
          throw new IllegalArgumentException("Invalid value for textCheckerQueueSize, must be >= 1: " + textCheckerQueueSize);
        }

        boolean atdMode = getOptionalProperty(props, "mode", "LanguageTool").equalsIgnoreCase("AfterTheDeadline");
        if (atdMode) {
          throw new IllegalArgumentException("The AfterTheDeadline mode is not supported anymore in LanguageTool 3.8 or later");
        }
        String rulesConfigFilePath = getOptionalProperty(props, "rulesFile", null);
        if (rulesConfigFilePath != null) {
          rulesConfigFile = new File(rulesConfigFilePath);
          if (!rulesConfigFile.exists() || !rulesConfigFile.isFile()) {
            throw new RuntimeException("Rules Configuration file cannot be found: " + rulesConfigFile);
          }
        }
        String remoteRulesConfigFilePath = getOptionalProperty(props, "remoteRulesFile", null);
        if (remoteRulesConfigFilePath != null) {
          remoteRulesConfigFile = new File(remoteRulesConfigFilePath);
          if (!remoteRulesConfigFile.exists() || !remoteRulesConfigFile.isFile()) {
            throw new RuntimeException("Remote rules configuration file cannot be found: " + remoteRulesConfigFile);

View on GitHub (pinned to 2e990059ce)

Solutions

  1. Set textCheckerQueueSize to 0 or a positive integer in the properties file
  2. Remove the property to use the default of 8
  3. Tune together with maxTextCheckerThreads to match expected load

Example fix

# before
textCheckerQueueSize=-8
# after
textCheckerQueueSize=16
Defensive patterns

Strategy: validation

Validate before calling

int q = Integer.parseInt(props.getProperty("textCheckerQueueSize", "8"));
if (q < 0) throw new IllegalArgumentException("textCheckerQueueSize must be >= 0, got " + q);

Try / catch

try { cfg = new HTTPServerConfig(props, args); } catch (IllegalArgumentException e) {
  if (e.getMessage().contains("textCheckerQueueSize")) { props.setProperty("textCheckerQueueSize", "8"); cfg = new HTTPServerConfig(props, args); } else throw e;
}

Prevention

When it happens

Trigger: Setting 'textCheckerQueueSize' to a negative integer in the properties file.

Common situations: Sign typos when tuning backpressure settings; generated configs with invalid defaults; misreading the (inconsistent) error message and avoiding the valid value 0.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


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