languagetool-org/languagetool · critical · RuntimeException

Could not start LanguageTool HTTPS server on , port

Error message

Could not start LanguageTool HTTPS server on , port 

What it means

HTTPSServer.main wraps server construction/startup so any Exception while starting the HTTPS server becomes RuntimeException('Could not start LanguageTool HTTPS server on <host>, port <port>'). It is the top-level startup failure for command-line HTTPS server runs.

Source

Thrown at languagetool-server/src/main/java/org/languagetool/server/HTTPSServer.java:149

      System.out.println("                 'password' - the keystore's password (deprecated, use a reverse proxy to handle SSL)");
      printCommonConfigFileOptions();
      printCommonOptions();
      System.exit(1);
    }
    try {
      HTTPSServerConfig config = new HTTPSServerConfig(args);
      try {
        checkForNonRootUser();
        HTTPSServer server;
        if (config.isPublicAccess()) {
          System.out.println("WARNING: running in public mode, LanguageTool API can be accessed without restrictions!");
          server = new HTTPSServer(config, false, null, null);
        } else {
          server = new HTTPSServer(config, false, DEFAULT_HOST, DEFAULT_ALLOWED_IPS);
        }
        server.run();
      } catch (Exception e) {
        throw new RuntimeException("Could not start LanguageTool HTTPS server on " + HTTPServerConfig.DEFAULT_HOST + ", port " + config.getPort(), e);
      }
    } catch (IllegalConfigurationException e) {
      System.out.println(e.getMessage());
      System.out.println("Note: this is the HTTPS server - if you want to use plain HTTP instead, please see https://dev.languagetool.org/http-server");
      System.exit(1);
    }
  }

  @Override
  protected String getProtocol() {
    return "https";
  }

}

View on GitHub (pinned to 2e990059ce)

Solutions

  1. Read the wrapped cause of this RuntimeException to find the underlying failure (usually port-in-use or SSL problem).
  2. Free the port or change the configured port.
  3. Fix keystore path/format/password (see error 315 steps).
  4. Check the --config property file for typos; see https://dev.languagetool.org/http-server for correct configuration.

Example fix

// before
port = 8081   // already in use
// after
port = 8083   # free port, or stop the conflicting process first
Defensive patterns

Strategy: try-catch

Validate before calling

// preflight: config file present, port free
if (!new File(configPath).canRead()) throw new IllegalStateException("missing config " + configPath);
try (ServerSocket s = new ServerSocket(port)) { /* free */ }

Try / catch

try {
  HTTPSServer.main(args);
} catch (RuntimeException e) {
  log.error("LT HTTPS startup failed: {}", e.getCause(), e);
  System.exit(1);
}

Prevention

When it happens

Trigger: Running the HTTPSServer main class where new HTTPSServer(...) or server.run() throws — most commonly a bound port (BindException) or SSL context failure (see errors 313-315).

Common situations: Command-line startup on a busy port; bad --config property file values (keystore/password); missing config leading to IllegalConfigurationException (handled separately with a note).

Related errors


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