You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Qingsheng Ren (Jira)" <ji...@apache.org> on 2024/04/03 10:17:00 UTC
[jira] [Assigned] (FLINK-34996) Custom Deserializer can't be instantiated when connector-kafka installed into Flink Libs
[ https://issues.apache.org/jira/browse/FLINK-34996?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Qingsheng Ren reassigned FLINK-34996:
-------------------------------------
Assignee: Hugo Gu
> Custom Deserializer can't be instantiated when connector-kafka installed into Flink Libs
> ----------------------------------------------------------------------------------------
>
> Key: FLINK-34996
> URL: https://issues.apache.org/jira/browse/FLINK-34996
> Project: Flink
> Issue Type: Bug
> Components: Connectors / Kafka
> Reporter: Hugo Gu
> Assignee: Hugo Gu
> Priority: Minor
> Labels: pull-request-available
> Attachments: image-2024-04-03-17-34-00-120.png, image-2024-04-03-17-37-55-105.png
>
>
> The current implementation of the
> KafkaValueOnlyDeserializerWrapper Class instantiates Deserializer from the ClassLoader of the KafkaValueOnlyDeserializerWrapper itself as following figure shows.
>
> !image-2024-04-03-17-34-00-120.png|width=799,height=293!
>
> In case of both following conditions are met:
> 1. The connector-kafka get installed into Libs of Flink (rather than in the User Jar)
> 2. The user jar defines a customized Deserializer for Kafka Record.
>
> The instantiation of the custom deserializer will fail due to NoClassFound exception because it is indeed not available in the system class loader.
>
> As following figure illustrates
>
> !image-2024-04-03-17-37-55-105.png|width=413,height=452!
>
> It can be fixed by using either UserCodeClassLoader or the ClassLoader of current Thread.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)