languagetool-org/languagetool · critical · RuntimeException
Could not start LanguageTool HTTP server on , port
Error message
Could not start LanguageTool HTTP server on , port
What it means
HTTPServer.main wraps server construction and run() in a try/catch and rethrows any Exception as a RuntimeException 'Could not start LanguageTool HTTP server on <host>, port <port>'. This is a generic wrapper: the causing exception (in the 'cause' field) holds the real reason, e.g. bind failure or invalid config.
Source
Thrown at languagetool-server/src/main/java/org/languagetool/server/HTTPServer.java:184
printCommonConfigFileOptions();
printCommonOptions();
System.exit(1);
}
HTTPServerConfig config = new HTTPServerConfig(args);
DatabaseAccess.init(config);
try {
checkForNonRootUser();
HTTPServer server;
if (config.isPublicAccess()) {
ServerTools.print("WARNING: running in HTTP mode, consider running LanguageTool behind a reverse proxy that takes care of encryption (HTTPS)");
ServerTools.print("WARNING: running in public mode, LanguageTool API can be accessed without restrictions!");
server = new HTTPServer(config, false, null, null);
} else {
server = new HTTPServer(config, false, DEFAULT_HOST, DEFAULT_ALLOWED_IPS);
}
server.run();
} catch (Exception e) {
throw new RuntimeException("Could not start LanguageTool HTTP server on " + DEFAULT_HOST + ", port " + config.getPort(), e);
}
}
@Override
protected String getProtocol() {
return "http";
}
}
View on GitHub (pinned to 2e990059ce)
Solutions
- Read the 'Caused by' of the RuntimeException stack trace for the root cause
- Free the configured port or choose another one if the cause is a bind failure
- Validate the config file and CLI arguments before startup
- Run with sufficient permissions and confirm the host/interface (DEFAULT_HOST) is bindable
Example fix
// before
throw new RuntimeException("Could not start LanguageTool HTTP server on " + DEFAULT_HOST + ", port " + config.getPort(), e);
// after (diagnose via cause)
try { server.run(); } catch (RuntimeException e) { e.getCause().printStackTrace(); } Defensive patterns
Strategy: try-catch
Try / catch
try { httpServerMain(args); } catch (RuntimeException e) {
Throwable cause = e.getCause();
log.error("LT server failed to start on {}:{} -> {}", host, port, cause == null ? e : cause);
} Prevention
- Always inspect getCause() — this message is only a wrapper
- Pre-check port availability and config validity before launch
- Log host/port from config on startup failure for faster diagnosis
When it happens
Trigger: Any exception during new HTTPServer(...) or server.run() in main(), most commonly an IOException from port binding (address already in use) or an IllegalArgumentException from invalid configuration.
Common situations: Port already occupied by another service; insufficient privileges to bind; malformed config file; previous wrapped errors 320/321 surfaced through this wrapper.
Related errors
- No free port in range ( - ) found.
- Invalid port configuration found. The value for '--port' nee
- WrongParameterNumberException
- listUnknownWords is set to false, unknown words not stored
- Unknown mode: <mode>
AI-assisted analysis of languagetool-org/languagetool@2e990059ce (2026-09-06).
Data as JSON: /api/errors/91fb7488f8a9a216.
Report an issue: GitHub.