RemoteException goes to remote clients EJBException goes to local clients
When something unexpected happens on the server, the Container tells the client by throwing either a RemoteException or an EJBException.
RemoteException is for remote clients only, and even though it is a checked exception, it’s telling the client that something unexpected happened. Something from which the client can’t recover.
EJBException is for local clients only, and it’s unchecked. In other words, EJBException is a subclass of RuntimeException. To the client, getting an EJBException isn’t much different from getting, say, an ArrayIndexOutOfBoundsException. It means something unexpected went wrong, and there’s nothing you can do to recover. The only difference is that the client does have to catch the RemoteException, but once he catches it, the client usually won’t be able to tell what happened (at least not in any recoverable way).
When something unexpected happens on the server, a local client gets a RuntimeException (EJBException) but a remote client gets a compiler-checked RemoteException
Remote client

Local client

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access