flink-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephan Ewen <se...@apache.org>
Subject Re: Looks like a ClassLoader bug
Date Wed, 18 Jun 2014 13:12:58 GMT
I think I know where the issue is:

In "InstantiationUtil", can you change the method

public static Object deserializeObject(byte[] bytes, ClassLoader cl) throws
IOException, ClassNotFoundException {
ObjectInputStream oois = null;
try {
oois = new ClassLoaderObjectInputStream(new ByteArrayInputStream(bytes),
cl);
return oois.readObject();
} finally {
if (oois != null) {
oois.close();
}
}
}



to something like

public static Object deserializeObject(byte[] bytes, ClassLoader cl) throws
IOException, ClassNotFoundException {
ObjectInputStream oois = null;
 final ClassLoader old = Thread.currentThread().getContextClassLoader();
 try {
oois = new ClassLoaderObjectInputStream(new ByteArrayInputStream(bytes),
cl);
return oois.readObject();
}
finally {
Thread.currentThread().setContextClassLoader(old);
 if (oois != null) {
oois.close();
}
}
}

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message