I have a common problem when I would like to hear your opinion that this is the best way to do this.
Suppose you have an application running on a distributed server system. Let the interface and the server speak. Methods on the server server called through RMI.
The backend java process usually needs different libraries than the java process interface. It is possible that a run-time exception is thrown in the backend. The thrown exception does not get into the backend, and therefore it is moved to an external server. The problem is that the interface does not know an exception, because the package is not in the classpath (for example, EJBTransactionRolledBackException). Another exception is thrown - a ClassNotFoundException. This makes it impossible to see where the execution occurred, because stacktrace does not include the stack from the server server. Another scenario that I can think of is where the exception cannot be serialized.
How do you solve this problem? Can I somehow register any runtime exception that is thrown without creating a try ... catch and rethrow block?
T3rm1 source share