quarkusio/quarkus · error · IllegalArgumentException

value is null

Error message

value is null

What it means

MutableBaseJvmOption.addValue(String) is a fluent builder for JVM option values and rejects null input with an IllegalArgumentException. The library treats a null value as a programming error in the caller rather than silently skipping it. Values are split on '|' and stored in a set, so a null would corrupt the stored value set.

Source

Thrown at independent-projects/bootstrap/app-model/src/main/java/io/quarkus/bootstrap/model/MutableBaseJvmOption.java:36

    private Set<String> values = Set.of();

    @Override
    public String getName() {
        return name;
    }

    @Override
    public Collection<String> getValues() {
        return values;
    }

    protected void setName(String name) {
        this.name = name;
    }

    public T addValue(String value) {
        if (value == null) {
            throw new IllegalArgumentException("value is null");
        }
        if (value.isBlank()) {
            throw new IllegalArgumentException("value is blank");
        }
        if (values.isEmpty()) {
            values = new HashSet<>(1);
        }
        for (String v : value.split("\\|")) {
            values.add(v);
        }
        return (T) this;
    }

    protected abstract String getPropertyGroupPrefix();

    protected abstract String getQuarkusExtensionPropertyPrefix();

    @Override

View on GitHub (pinned to e1c734241f)

Solutions

  1. Pass a non-null string; if the value may be missing, check for null before calling addValue()
  2. Use an empty-string/default fallback or skip calling addValue when the source value is null
  3. Inspect the stack trace to find which option name is being populated and fix the source of the null

Example fix

// before
String val = System.getProperty("my.opt");
option.addValue(val);
// after
String val = System.getProperty("my.opt");
if (val != null && !val.isBlank()) {
    option.addValue(val);
}
Defensive patterns

Strategy: validation

Validate before calling

if (value != null) {
    option.addValue(value);
}

Type guard

boolean isNonEmpty(String s) { return s != null && !s.isBlank(); }

Try / catch

try {
    option.addValue(value);
} catch (IllegalArgumentException e) {
    log.warnf("Rejected JVM option value: %s", e.getMessage());
}

Prevention

When it happens

Trigger: Calling addValue(null) directly, or passing a variable/expression that evaluates to null (e.g. a system property or config lookup that returned null) into addValue().

Common situations: Programmatically building JVM options from environment variables or config maps where a lookup returned null and was not defaulted; copying options from another source where a value slot is unset.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/5fa6a0dc8ebdcdc8. Report an issue: GitHub.