{"record":{"id":"e75654480188c921","repo":"eclipse-vertx/vert.x","slug":"invalid-type-for-message-header-value-entry-getv","errorCode":null,"errorMessage":"Invalid type for message header value ${entry.getValue().getClass()}","messagePattern":"Invalid type for message header value (.+?)","errorType":"exception","errorClass":"java.lang.IllegalStateException","httpStatus":null,"severity":"error","filePath":"vertx-core/src/main/java/io/vertx/core/eventbus/DeliveryOptions.java","lineNumber":90,"sourceCode":"    }\n    this.localOnly = other.localOnly;\n    this.tracingPolicy = other.tracingPolicy;\n  }\n\n  /**\n   * Create a delivery options from JSON\n   *\n   * @param json  the JSON\n   */\n  public DeliveryOptions(JsonObject json) {\n    this.timeout = json.getLong(\"timeout\", DEFAULT_TIMEOUT);\n    this.codecName = json.getString(\"codecName\", null);\n    JsonObject hdrs = json.getJsonObject(\"headers\", null);\n    if (hdrs != null) {\n      headers = MultiMap.caseInsensitiveMultiMap();\n      for (Map.Entry<String, Object> entry : hdrs) {\n        if (!(entry.getValue() instanceof String)) {\n          throw new IllegalStateException(\"Invalid type for message header value \" + entry.getValue().getClass());\n        }\n        headers.set(entry.getKey(), (String) entry.getValue());\n      }\n    }\n    this.localOnly = json.getBoolean(\"localOnly\", DEFAULT_LOCAL_ONLY);\n    String tracingPolicyStr = json.getString(\"tracingPolicy\");\n    this.tracingPolicy = tracingPolicyStr != null ? TracingPolicy.valueOf(tracingPolicyStr) : DEFAULT_TRACING_POLICY;\n  }\n\n  /**\n   * Convert to JSON.\n   *\n   * @return the JSON\n   */\n  public JsonObject toJson() {\n    JsonObject json = new JsonObject();\n    json.put(\"timeout\", timeout);\n    if (codecName != null) json.put(\"codecName\", codecName);","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/eclipse-vertx/vert.x/blob/fb308bd8c3f12c79f4ae89bef67fadf6c80d036e/vertx-core/src/main/java/io/vertx/core/eventbus/DeliveryOptions.java#L72-L108","documentation":"JSON deserialization guard in the DeliveryOptions(JsonObject) constructor: a message header value in the 'headers' object is not a String (its actual class is reported in the message). Vert.x delivery headers only accept string values, so non-string JSON values are rejected during construction.","triggerScenarios":"Thrown at vertx-core/src/main/java/io/vertx/core/eventbus/DeliveryOptions.java:90 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Convert header values to strings in the JSON source","Validate the headers object types before creating DeliveryOptions from JSON"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fb308bd8c3f12c79f4ae89bef67fadf6c80d036e","analyzedAt":"2026-09-06T11:37:12.241Z","contentChangedAt":"2026-09-06T11:37:12.241Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}