[
https://issues.apache.org/jira/browse/FLINK-34996?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17875463#comment-17875463
]
Hugo Gu commented on FLINK-34996:
---------------------------------
[~renqs] , I have raised
[PR|https://github.com/apache/flink-connector-kafka/pull/89] for this small
bug, but it has been approved but pending for a merge for quite a while, not
sure if you can help here? Thanks.
> 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
>
> Time Spent: 3h
> Remaining Estimate: 0h
>
> 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)