{"record":{"id":"7b0e3c5d2d379b4b","repo":"apache/beam","slug":"could-not-extract-the-kafka-deserializer-type-from-s","errorCode":null,"errorMessage":"Could not extract the Kafka Deserializer type from %s","messagePattern":"Could not extract the Kafka Deserializer type from (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/LocalDeserializerProvider.java","lineNumber":101,"sourceCode":"\n      if (parameterizedType.getRawType() == Deserializer.class) {\n        Type parameter = parameterizedType.getActualTypeArguments()[0];\n\n        @SuppressWarnings(\"unchecked\")\n        Class<T> clazz = (Class<T>) parameter;\n\n        try {\n          return NullableCoder.of(coderRegistry.getCoder(clazz));\n        } catch (CannotProvideCoderException e) {\n          throw new RuntimeException(\n              String.format(\n                  \"Unable to automatically infer a Coder for \"\n                      + \"the Kafka Deserializer %s: no coder registered for type %s\",\n                  deserializer, clazz));\n        }\n      }\n    }\n    throw new RuntimeException(\n        String.format(\"Could not extract the Kafka Deserializer type from %s\", deserializer));\n  }\n}\n","sourceCodeStart":83,"sourceCodeEnd":105,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/LocalDeserializerProvider.java#L83-L105","documentation":"In getNullableCoder, the deserializer class's generic interfaces are scanned for a direct parameterized Deserializer<T> super-interface. If none is found (the deserializer extends Deserializer indirectly or is raw/generic-less), the type argument cannot be extracted and this RuntimeException is thrown — coder inference is impossible for such classes.","triggerScenarios":"Thrown at sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/LocalDeserializerProvider.java:101 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Make the deserializer directly implement Deserializer<T> with a concrete type parameter.","Supply the Coder explicitly rather than relying on automatic inference.","Wrap the deserializer in a concrete class declaring its target type."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}