quarkusio/quarkus · error · IllegalArgumentException

values was null

Error message

values was null

What it means

IllegalArgumentException from LinkBuilderImpl.buildRelativized (and the related build overloads): the varargs values array passed for URI template substitution is null. A sentinel null-check guard on builder input; the values argument is at fault.

Source

Thrown at independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/jaxrs/LinkBuilderImpl.java:115

            throw new IllegalArgumentException("param was null");
        URI built = null;
        if (uriBuilder == null) {
            built = baseUri;
        } else {
            built = this.uriBuilder.build(values);
        }
        if (!built.isAbsolute() && baseUri != null) {
            built = baseUri.resolve(built);
        }
        return new LinkImpl(built, this.map);
    }

    @Override
    public Link buildRelativized(URI uri, Object... values) {
        if (uri == null)
            throw new IllegalArgumentException("URI was null");
        if (values == null)
            throw new IllegalArgumentException("values was null");
        URI built = uriBuilder.build(values);
        URI with = built;
        if (baseUri != null)
            with = baseUri.resolve(built);
        return new LinkImpl(uri.relativize(with), this.map);
    }

    @Override
    public Link.Builder baseUri(URI uri) {
        this.baseUri = uri;
        return this;
    }

    @Override
    public Link.Builder baseUri(String uri) {
        this.baseUri = URI.create(uri);
        return this;
    }

View on GitHub (pinned to e1c734241f)

Solutions

  1. Pass an empty array instead of null when no values are needed.
  2. Initialize: values != null ? values : new Object[0].
  3. Ensure collections feeding the array are initialized.

Example fix

// before
Link link = builder.buildRelativized(uri, params);
// after
Link link = builder.buildRelativized(uri, params != null ? params : new Object[0]);
Defensive patterns

Strategy: validation

Validate before calling

Object[] safeValues = values != null ? values : new Object[0];

Type guard

Object[] nonNullOrArray(Object[] values) { return values != null ? values : new Object[0]; }

Try / catch

try { return builder.buildRelativized(uri, values); } catch (IllegalArgumentException e) { return builder.buildRelativized(uri); }

Prevention

When it happens

Trigger: Calling buildRelativized(uri, (Object[]) null).

Common situations: Nullable arrays built at runtime; passing a null List's toArray result from an uninitialized collection.

Related errors


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