{
  "id": "java/not-serializable-exception",
  "signature": "java.io.NotSerializableException: com.example.MyClass",
  "signature_zh": "java.io.NotSerializableException: com.example.MyClass",
  "regex": "java\\.io\\.NotSerializableException",
  "domain": "java",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "An object of a class that does not implement java.io.Serializable is being serialized, typically during object output, RMI, or session replication.",
  "root_cause_type": "generic",
  "root_cause_zh": "尝试序列化未实现 java.io.Serializable 接口的类的对象，通常发生在对象输出、RMI 或会话复制过程中。",
  "versions": [
    {
      "version": "Java 8",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Java 11",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Java 17",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Java 21",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The serialVersionUID field is only relevant for Serializable classes; without implementing the interface, the exception persists.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Transient fields prevent serialization of those fields, but the class itself must still implement Serializable to be serialized.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Implement java.io.Serializable in the class: public class MyClass implements Serializable { private static final long serialVersionUID = 1L; }",
      "success_rate": 0.95,
      "how": "Implement java.io.Serializable in the class: public class MyClass implements Serializable { private static final long serialVersionUID = 1L; }",
      "condition": "",
      "sources": []
    },
    {
      "action": "If the class cannot be modified, use a custom serialization mechanism like Jackson or writeExternal for Externalizable.",
      "success_rate": 0.75,
      "how": "If the class cannot be modified, use a custom serialization mechanism like Jackson or writeExternal for Externalizable.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Implement java.io.Serializable in the class: public class MyClass implements Serializable { private static final long serialVersionUID = 1L; }",
    "If the class cannot be modified, use a custom serialization mechanism like Jackson or writeExternal for Externalizable."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/NotSerializableException.html",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.92,
  "resolvable": "true",
  "first_seen": "2024-01-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}