[
https://issues.apache.org/jira/browse/FLINK-21138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17273371#comment-17273371
]
Maciej Prochniak commented on FLINK-21138:
------------------------------------------
I think using original.getClass().getClassLoader() won't work here - "original"
is SerializableSerializer wrapper, which is probably loaded by framework
classloader. I think with such custom serializers the part loaded by user
classloader can hidden via quite a few wrappers/decorators and using
contextClassloader is safer, it's done like that also here:
[here|https://github.com/apache/flink/blob/master/flink-runtime/src/main/java/org/apache/flink/runtime/state/JavaSerializer.java#L59]
I'll try to come up with PR with test
> KvStateServerHandler is not invoked with user code classloader
> --------------------------------------------------------------
>
> Key: FLINK-21138
> URL: https://issues.apache.org/jira/browse/FLINK-21138
> Project: Flink
> Issue Type: Bug
> Components: Runtime / Queryable State
> Affects Versions: 1.11.2
> Reporter: Maciej Prochniak
> Priority: Major
> Attachments: TestJob.java, stacktrace
>
>
> When using e.g. custom Kryo serializers user code classloader has to be set
> as context classloader during invocation of methods such as
> TypeSerializer.duplicat()
> KvStateServerHandler does not do this, which leads to exceptions like
> ClassNotFound etc.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)