{"record":{"id":"271d0a4c1404c6ab","repo":"apache/beam","slug":"could-not-instantiate-deserializers","errorCode":null,"errorMessage":"Could not instantiate deserializers","messagePattern":"Could not instantiate deserializers","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":59,"sourceCode":"    checkArgument(deserializer != null, \"You should provide a deserializer.\");\n    this.deserializer = deserializer;\n  }\n\n  static <T> LocalDeserializerProvider<T> of(Class<? extends Deserializer<T>> deserializer) {\n    return new LocalDeserializerProvider<>(deserializer);\n  }\n\n  @Override\n  public Deserializer<T> getDeserializer(Map<String, ?> configs, boolean isKey) {\n    try {\n      Deserializer<T> deserializer = this.deserializer.getDeclaredConstructor().newInstance();\n      deserializer.configure(configs, isKey);\n      return deserializer;\n    } catch (InstantiationException\n        | IllegalAccessException\n        | InvocationTargetException\n        | NoSuchMethodException e) {\n      throw new RuntimeException(\"Could not instantiate deserializers\", e);\n    }\n  }\n\n  /**\n   * Attempt to infer a {@link Coder} by extracting the type of the deserialized-class from the\n   * deserializer argument using the {@link Coder} registry.\n   */\n  @Override\n  public Coder<T> getCoder(CoderRegistry coderRegistry) {\n    // It is safe to treat a Coder<@Nullable T> as a Coder<T> for deserialization\n    // purposes\n    return (Coder<T>) getNullableCoder(coderRegistry);\n  }\n\n  public NullableCoder<T> getNullableCoder(CoderRegistry coderRegistry) {\n    for (Type type : deserializer.getGenericInterfaces()) {\n      if (!(type instanceof ParameterizedType)) {\n        continue;","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/LocalDeserializerProvider.java#L41-L77","documentation":"LocalDeserializerProvider.getDeserializer reflectively instantiates the configured Deserializer class per consumer. If instantiation or configure() fails (no no-arg constructor, abstract class, access or config errors — InstantiationException, IllegalAccessException, InvocationTargetException, ClassNotFoundException), the multi-catch is rethrown as RuntimeException 'Could not instantiate deserializers'.","triggerScenarios":"Thrown at sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/LocalDeserializerProvider.java:59 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the deserializer class is public, concrete, and has a public no-arg constructor.","Confirm the class is on the runtime classpath (no ClassNotFoundException).","Inspect the wrapped cause for the failure from configure(configs, isKey)."],"exampleFix":null,"handlingStrategy":"try-catch","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"}