eclipse-vertx/vert.x · error · VertxException

${e}

Error message

${e}

What it means

JsonParserImpl's constructor creates a Jackson non-blocking byte-array parser. If Jackson cannot instantiate that parser, the constructor wraps the cause in a generic VertxException with message = the exception's toString. This is an infrastructure/init failure, not a JSON content failure.

Source

Thrown at vertx-core/src/main/java/io/vertx/core/parsetools/impl/JsonParserImpl.java:63

  private boolean objectValueMode;
  private boolean arrayValueMode;
  private Handler<Throwable> exceptionHandler;
  private String currentField;
  private Handler<Void> endHandler;
  private long demand = Long.MAX_VALUE;
  private boolean ended;
  private final ReadStream<Buffer> stream;
  private boolean emitting;
  private final Deque<JsonEventImpl> pending = new ArrayDeque<>();
  private List<IOException> collectedExceptions;

  public JsonParserImpl(ReadStream<Buffer> stream) {
    this.stream = stream;
    JsonFactory factory = new JsonFactory();
    try {
      parser = (NonBlockingJsonParser) factory.createNonBlockingByteArrayParser();
    } catch (Exception e) {
      throw new VertxException(e);
    }
  }

  @Override
  public JsonParser pause() {
    demand = 0L;
    return this;
  }

  @Override
  public JsonParser resume() {
    return fetch(Long.MAX_VALUE);
  }

  @Override
  public JsonParser fetch(long amount) {
    Arguments.require(amount > 0L, "Fetch amount must be > 0L");
    demand += amount;

View on GitHub (pinned to fb308bd8c3)

Solutions

  1. Check the exception cause (VertxException.getCause()) to confirm the Jackson failure
  2. Ensure jackson-core >= 2.9 is on the classpath and not overridden by an older transitive version
  3. Run mvn dependency:tree (or equivalent) and exclude/pin conflicting Jackson versions

Example fix

// before (pom.xml)
<dependency><groupId>com.fasterxml.jackson.core</groupId><artifactId>jackson-core</artifactId><version>2.8.11</version></dependency>
// after
<dependency><groupId>com.fasterxml.jackson.core</groupId><artifactId>jackson-core</artifactId><version>2.15.3</version></dependency>
Defensive patterns

Strategy: try-catch

Try / catch

JsonParser parser;
try {
  parser = JsonParser.newParser(stream);
} catch (VertxException e) {
  throw new IllegalStateException("Failed to init JSON parser (check jackson-core version >= 2.9)", e);
}

Prevention

When it happens

Trigger: Constructing JsonParser (via JsonParser.newParser(...) or newParser(stream)) when Jackson's JsonFactory fails to create the non-blocking parser — e.g. an incompatible jackson-core version on the classpath.

Common situations: Dependency conflicts where an old jackson-core lacks createNonBlockingByteArrayParser (introduced in Jackson 2.9); shaded/classloader issues in application servers; mixed Jackson versions in a fat jar.

Related errors


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