{"record":{"id":"43157db2b92a72eb","repo":"apache/hadoop","slug":"cannot-write-objects-of-this-type","errorCode":null,"errorMessage":"cannot write objects of this type","messagePattern":"cannot write objects of this type","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-streaming/src/main/java/org/apache/hadoop/typedbytes/TypedBytesOutput.java","lineNumber":101,"sourceCode":"      writeBool((Boolean) obj);\n    } else if (obj instanceof Integer) {\n      writeInt((Integer) obj);\n    } else if (obj instanceof Long) {\n      writeLong((Long) obj);\n    } else if (obj instanceof Float) {\n      writeFloat((Float) obj);\n    } else if (obj instanceof Double) {\n      writeDouble((Double) obj);\n    } else if (obj instanceof String) {\n      writeString((String) obj);\n    } else if (obj instanceof ArrayList) {\n      writeVector((ArrayList) obj);\n    } else if (obj instanceof List) {\n      writeList((List) obj);\n    } else if (obj instanceof Map) {\n      writeMap((Map) obj);\n    } else {\n      throw new RuntimeException(\"cannot write objects of this type\");\n    }\n  }\n\n  /**\n   * Writes a raw sequence of typed bytes.\n   * \n   * @param bytes the bytes to be written\n   * @throws IOException\n   */\n  public void writeRaw(byte[] bytes) throws IOException {\n    out.write(bytes);\n  }\n\n  /**\n   * Writes a raw sequence of typed bytes.\n   * \n   * @param bytes the bytes to be written\n   * @param offset an offset in the given array","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-streaming/src/main/java/org/apache/hadoop/typedbytes/TypedBytesOutput.java#L83-L119","documentation":"Error \"cannot write objects of this type\" thrown in apache/hadoop.","triggerScenarios":"TypedBytesOutput is asked to serialize a Java object of a type with no typedbytes encoding.","commonSituations":"See trigger scenarios.","solutions":["Write only types supported by TypedBytesOutput (primitives, String, bytes, lists, maps); the given object type is unsupported."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}