Description
has the following code:
AsyncResponse.java does not restore the context classloader correctly. For example:
protected void onError(Throwable flt, MessageContext mc, ClassLoader cl) {
setThreadClassLoader(cl);
onError(flt, mc);
ClassLoader origClassLoader = (ClassLoader)AccessController.doPrivileged(new PrivilegedAction() {
public Object run()
});
setThreadClassLoader(origClassLoader);
}
The origClassLoader is retrieved after new class loader is already set on the thread so really origClassLoader == cl. The origClassLoader should be obtained before the first setThreadClassLoader(cl) call. Same problem applies to onCompleted() call.