eclipse-vertx/vert.x · error · EncodeException

Mapping is not available without Jackson Databind on the cl

Error message

Mapping  is not available without Jackson Databind on the classpath

What it means

Dependency capability error in JacksonCodec.encodeJson: POJO/Map-to-JSON mapping was requested, but only jackson-core is on the classpath (jackson-databind missing). The message is a static sentinel ('Mapping is not available...'); the input at fault is a non-basic object passed for encoding that requires databind serialization.

Source

Thrown at vertx-core/src/main/java/io/vertx/core/json/jackson/JacksonCodec.java:420

      } else if (json instanceof JsonArray) {
        json = ((JsonArray)json).getList();
      }
      if (json instanceof Map) {
        generator.writeStartObject();
        for (Map.Entry<String, ?> e : ((Map<String, ?>)json).entrySet()) {
          generator.writeFieldName(e.getKey());
          Object value = e.getValue();
          encodeJson0(value, generator);
        }
        generator.writeEndObject();
      } else if (json instanceof List) {
        generator.writeStartArray();
        for (Object item : (List<?>) json) {
          encodeJson0(item, generator);
        }
        generator.writeEndArray();
      } else if (!encodeSingleType(generator, json)) {
        throw new EncodeException("Mapping " + json.getClass().getName() + "  is not available without Jackson Databind on the classpath");
      }
    } catch (IOException e) {
      throw new EncodeException(e.getMessage(), e);
    }
  }

  /**
   * This is a way to overcome a limit of OpenJDK on MaxRecursiveInlineLevel:
   * avoiding the "direct" recursive calls allow the JIT to have a better inlining budget for the recursive calls.
   */
  private static void encodeJson0(Object json, JsonGenerator generator) throws EncodeException {
    try {
      if (json instanceof JsonObject) {
        json = ((JsonObject)json).getMap();
      } else if (json instanceof JsonArray) {
        json = ((JsonArray)json).getList();
      }
      if (json instanceof Map) {

View on GitHub (pinned to fb308bd8c3)

Solutions

  1. Add jackson-databind to the classpath to enable POJO mapping
  2. Encode only built-in JSON types (Map, List, primitives) without databind
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at vertx-core/src/main/java/io/vertx/core/json/jackson/JacksonCodec.java:420 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/5af4a3316bb47b7e. Report an issue: GitHub.