eclipse-vertx/vert.x · error · NullPointerException

Null delegate not allowed

Error message

Null delegate not allowed

What it means

Null guard in the HttpServerRequestWrapper constructor: the wrapped HttpServerRequest delegate passed in is null. The wrapper forwards every call to the delegate field, so a null delegate is rejected immediately with this generic sentinel.

Source

Thrown at vertx-core/src/main/java/io/vertx/core/internal/http/HttpServerRequestWrapper.java:34

import io.vertx.core.net.NetSocket;

import java.util.Set;

/**
 * A wrapper class that delegates all method calls to the {@link #delegate} instance.
 *
 * Implementing {@link HttpServerRequest} or extending {@link HttpServerRequestInternal} is not encouraged however if that is necessary,
 * implementations should favor extending this class to ensure minimum breakage when new methods are added to the interface.
 *
 * The delegate instance can be accessed using protected final {@link #delegate} field, any implemented method can be overridden.
 */
public class HttpServerRequestWrapper extends HttpServerRequestInternal {

  protected final HttpServerRequestInternal delegate;

  public HttpServerRequestWrapper(HttpServerRequestInternal delegate) {
    if (delegate == null) {
      throw new NullPointerException("Null delegate not allowed");
    }
    this.delegate = delegate;
  }

  @Override
  public HttpServerRequest exceptionHandler(Handler<Throwable> handler) {
    return delegate.exceptionHandler(handler);
  }

  @Override
  public HttpServerRequest handler(Handler<Buffer> handler) {
    return delegate.handler(handler);
  }

  @Override
  public HttpServerRequest pause() {
    return delegate.pause();
  }

View on GitHub (pinned to fb308bd8c3)

Solutions

  1. Pass a non-null HttpServerRequest when constructing the wrapper
  2. Guard wrapper creation sites for null requests
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at vertx-core/src/main/java/io/vertx/core/internal/http/HttpServerRequestWrapper.java:34 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of eclipse-vertx/vert.x@fb308bd8c3 (2026-09-06). Data as JSON: /api/errors/a340f627283b369c. Report an issue: GitHub.