aeron-io/aeron · error · NullPointerException
input string must not be null or empty
Error message
input string must not be null or empty
What it means
SocketAddressParser.parse throws NullPointerException when the input string is null or empty, before any parsing occurs. The parser requires a concrete host:port string to resolve into an InetSocketAddress. The NPE intentionally encodes 'missing required input'.
Solutions
- Ensure the channel URI includes a non-empty endpoint or control value, e.g. aeron:udp?endpoint=127.0.0.1:40456
- Check the custom NameResolver implementation's lookup() never returns null/empty for configured names
- Catch NullPointerException from parse and log the offending URI parameter name to find the empty value
Example fix
// before String uri = "aeron:udp?endpoint="; // empty endpoint // after String uri = "aeron:udp?endpoint=127.0.0.1:40456";
Defensive patterns
Strategy: validation
Validate before calling
if (value == null || value.isEmpty()) {
throw new IllegalArgumentException("endpoint/control value for " + paramName + " must not be empty");
} Try / catch
try {
InetSocketAddress addr = SocketAddressParser.parse(value, name, false, NameResolver.NULL_NAME_RESOLVER);
} catch (NullPointerException e) {
// value was null/empty: fix URI or resolver
} Prevention
- Never emit URI parameters with empty values; omit them instead
- Test custom NameResolver.lookup() implementations for empty returns
- Validate URIs at startup before handing them to Aeron
When it happens
Trigger: Calling SocketAddressParser.parse(null, ...) or parse("", paramName, ...), typically when a channel URI parameter (endpoint or control) is empty or a NameResolver lookup yields an empty value.
Common situations: Channel URI missing the endpoint value entirely (aeron:udp?endpoint=); URI parameter extraction returning empty string; custom NameResolver returning empty lookup results.
Understand the failure class
Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.
Related errors
- invalid format:
- address:port is required for ipv4:
- [address]:port is required for ipv6:
- Aeron URIs must start with 'aeron:', found
- 'control-mode=dynamic' requires that 'control' parameter is…
AI-assisted analysis of aeron-io/aeron@6d60124e15 (2026-09-12).
Data as JSON: /api/errors/90f64ff7b8d8e246.
Report an issue: GitHub.
Appendix: source
Thrown at aeron-driver/src/main/java/io/aeron/driver/media/SocketAddressParser.java:55
}
/**
* Parse socket addresses from a {@link String}.
* <p>
* Supports hostname:port, ipV4Address:port, [ipV6Address]:port, and name.
*
* @param value to be parsed for the socket address.
* @param uriParamName for the parse.
* @param isReResolution for the parse.
* @param nameResolver to be used for resolving hostnames.
* @return An {@link InetSocketAddress} for the parsed input.
*/
static InetSocketAddress parse(
final String value, final String uriParamName, final boolean isReResolution, final NameResolver nameResolver)
{
if (Strings.isEmpty(value))
{
throw new NullPointerException("input string must not be null or empty");
}
final String nameAndPort = nameResolver.lookup(value, uriParamName, isReResolution);
ParseResult result = tryParseIpV4(nameAndPort);
if (null == result)
{
result = tryParseIpV6(nameAndPort);
}
if (null == result)
{
throw new IllegalArgumentException("invalid format: " + nameAndPort);
}
final InetAddress inetAddress = nameResolver.resolve(result.host, uriParamName, isReResolution);
return null == inetAddress ? InetSocketAddress.createUnresolved(result.host, result.port) :
new InetSocketAddress(inetAddress, result.port);
}
View on GitHub (pinned to 6d60124e15)