提交 4a74f328 编写于 作者: F Fabian Hueske

[FLINK-1265] Fix user classloader bug for registerInputOutput() method

上级 a77d7520
......@@ -177,7 +177,16 @@ public class RuntimeEnvironment implements Environment, BufferProvider, LocalBuf
this.taskConfiguration = tdd.getTaskConfiguration();
this.invokable.setEnvironment(this);
this.invokable.registerInputOutput();
// make sure that user classloader is available, because registerInputOutput might call usercode
{
Thread currentThread = Thread.currentThread();
ClassLoader context = currentThread.getContextClassLoader();
currentThread.setContextClassLoader(userCodeClassLoader);
this.invokable.registerInputOutput();
currentThread.setContextClassLoader(context);
}
List<GateDeploymentDescriptor> inGates = tdd.getInputGates();
List<GateDeploymentDescriptor> outGates = tdd.getOutputGates();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册