RemoteRpcInvocation tries to give a more detailed ClassNotFoundException if the method type/argument deserialization fails. However, it turns out, once ObjectInputStream has received a ClassNotFoundException, it will not overwrite this anymore and we can therefore not provide a more detailed ClassNotFoundException.
Instead, the least invasive solution would be to add a suppressed ClassNotFoundException to the existing one. While at it, we could also add more details, i.e. the successfully deserialized types and arguments.