[ https://issues.apache.org/jira/browse/FLINK-21138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17273026#comment-17273026 ]
Till Rohrmann commented on FLINK-21138: --------------------------------------- Thanks for posting this example. I am wondering whether the problem isn't that we are using the {{Thread.currentThread().getContextClassLoader()}} [here|https://github.com/apache/flink/blob/master/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/kryo/KryoSerializer.java#L626] instead of {{original.getClass().getClassLoader()}}. I think this should fix the problem. Test-wise you could take a look at the {{PojoSerializerUpgradeTest.testPojoSerializerUpgrade}} which creates a new class and instantiates an {{URLClassLoader}} to load it. If you then use the test thread, it should not know about this new class. > 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)