{"record":{"id":"bce251f464b3b887","repo":"eclipse-vertx/vert.x","slug":"no-message-codec-for-type","errorCode":null,"errorMessage":"No message codec for type: ","messagePattern":"No message codec for type: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"vertx-core/src/main/java/io/vertx/core/eventbus/impl/CodecManager.java","lineNumber":119,"sourceCode":"    } else if (body instanceof ReplyException) {\n      codec = defaultCodecMap.get(body.getClass());\n      if (codec == null) {\n        codec = REPLY_EXCEPTION_MESSAGE_CODEC;\n      }\n    } else {\n      codec = defaultCodecMap.get(body.getClass());\n      if (codec == null) {\n        if ((codecName = codecSelector.apply(body)) != null) {\n          codec = getCodec(codecName);\n        } else if (body instanceof ClusterSerializable && (local || acceptClusterSerializable(body.getClass().getName()))) {\n          codec = clusterSerializableCodec;\n        } else if (body instanceof Serializable && (local || acceptSerializable(body.getClass().getName()))) {\n          codec = serializableCodec;\n        }\n      }\n    }\n    if (codec == null) {\n      throw new IllegalArgumentException(\"No message codec for type: \" + body.getClass());\n    }\n    return codec;\n  }\n\n  public MessageCodec getCodec(String codecName) {\n    return userCodecMap.get(codecName);\n  }\n\n  public void registerCodec(MessageCodec codec) {\n    Objects.requireNonNull(codec, \"codec\");\n    Objects.requireNonNull(codec.name(), \"code.name()\");\n    checkSystemCodec(codec);\n    if (userCodecMap.containsKey(codec.name())) {\n      throw new IllegalStateException(\"Already a codec registered with name \" + codec.name());\n    }\n    userCodecMap.put(codec.name(), codec);\n  }\n","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/eclipse-vertx/vert.x/blob/fb308bd8c3f12c79f4ae89bef67fadf6c80d036e/vertx-core/src/main/java/io/vertx/core/eventbus/impl/CodecManager.java#L101-L137","documentation":"Codec lookup failure in CodecManager.lookupCodec: no message codec is registered for the message body's class. The message is a generic sentinel; the input at fault is the body object being sent on the event bus, whose type has no default codec, no system-codec, is not ClusterSerializable/Serializable (or those are not accepted in this mode), and no user codec was registered under a selected codec name.","triggerScenarios":"Thrown at vertx-core/src/main/java/io/vertx/core/eventbus/impl/CodecManager.java:119 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Register a MessageCodec for the body type via eventBus.registerDefaultCodec","Send a supported type (String, JsonObject, byte[], ClusterSerializable, ...) instead","For custom POJOs, provide a codec name via a CodecSelector"],"exampleFix":null,"handlingStrategy":"fallback","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-14T05:17:10.506Z"}