How are you gonna extend RemoteException with your own ServiceException As far as I know RemoteException is already an existing exception, and Java does not support multiple inheritance, so I'm quiet confused about your question
So actually your ServiceException is extending RemoteException and not in the other direction
I don't think that's a good idea. Your ServiceException is-NOT-a RemoteException, so you should not use RemoteException from a design perspective.
I will describe my approach in exception handling: I created a specific service exception for each possible exception that could occur (room already booked, no rooms found,...). In my controller (at the client) I catch all the possible service exceptions (depending on the invoked method) AND a RemoteException. I rethrow a specific client-side exception (which wraps the (original) caught exception with an appropriate message for the user. So in my view I just have to catch this specific client-side exception and I can simply show the message to the user (and also log the exception, when needed).
Thanks Roel for the reply
Glad we cleared the who is extending who issue
hmm isnt this kinda like wrapping a FileNotFoundException with say a DataAccessException in the db-layer? Ofcourse I dont extend it but ... anyway.
Yes, that's the same principle. So you are hiding the implementation details, which is a thing from a design perspective. Because you can replace the existing implementation (using a database file) with a complete new implementation (using a RDBMS for example) without having to change anything besides your implementation class
Yes, you could do it in the service layer (as you described in a previous post), bu my remark still stands: you'll need inheritance, although your ServiceException is-NOT-a RemoteException, so from a design perspective it's not a good thing to do. But it's your choice (and don't forget to document it).