[
https://issues.apache.org/jira/browse/FLINK-6606?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16016007#comment-16016007
]
ASF GitHub Bot commented on FLINK-6606:
---------------------------------------
Github user rmetzger commented on the issue:
https://github.com/apache/flink/pull/3933
Till and I had an offline discussion about this.
What you can do in your user code to set the TCCL properly is the following:
```
Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
```
`this` points in user code to a class loaded through the user code
classlaoder. So `this.getClass().getClassLoader()` is the CL you need to set
for the thread.
> Create checkpoint hook with user classloader
> --------------------------------------------
>
> Key: FLINK-6606
> URL: https://issues.apache.org/jira/browse/FLINK-6606
> Project: Flink
> Issue Type: Bug
> Components: State Backends, Checkpointing
> Reporter: Eron Wright
> Assignee: Eron Wright
> Priority: Blocker
> Fix For: 1.3.0
>
>
> Flink should set the thread's classloader when calling the checkpoint hook
> factory's `create` method. Without that, the hook is likely to fail during
> initialization (e.g. using ServiceLoader).
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)