apache/hadoop · error · RuntimeException

cannot write objects of this type

Error message

cannot write objects of this type

What it means

Error "cannot write objects of this type" thrown in apache/hadoop.

Source

Thrown at hadoop-tools/hadoop-streaming/src/main/java/org/apache/hadoop/typedbytes/TypedBytesOutput.java:101

      writeBool((Boolean) obj);
    } else if (obj instanceof Integer) {
      writeInt((Integer) obj);
    } else if (obj instanceof Long) {
      writeLong((Long) obj);
    } else if (obj instanceof Float) {
      writeFloat((Float) obj);
    } else if (obj instanceof Double) {
      writeDouble((Double) obj);
    } else if (obj instanceof String) {
      writeString((String) obj);
    } else if (obj instanceof ArrayList) {
      writeVector((ArrayList) obj);
    } else if (obj instanceof List) {
      writeList((List) obj);
    } else if (obj instanceof Map) {
      writeMap((Map) obj);
    } else {
      throw new RuntimeException("cannot write objects of this type");
    }
  }

  /**
   * Writes a raw sequence of typed bytes.
   * 
   * @param bytes the bytes to be written
   * @throws IOException
   */
  public void writeRaw(byte[] bytes) throws IOException {
    out.write(bytes);
  }

  /**
   * Writes a raw sequence of typed bytes.
   * 
   * @param bytes the bytes to be written
   * @param offset an offset in the given array

View on GitHub (pinned to 2add963021)

Solutions

  1. Write only types supported by TypedBytesOutput (primitives, String, bytes, lists, maps); the given object type is unsupported.

When it happens

Trigger: TypedBytesOutput is asked to serialize a Java object of a type with no typedbytes encoding.

Common situations: See trigger scenarios.


AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22). Data as JSON: /api/errors/43157db2b92a72eb. Report an issue: GitHub.