Hi,
I have a question regarding exceptions raised from within an EJB.

Context: I want to raise application exceptions from within my session bean. These will be caught by the client (a servlet or a java application) and an appropriate error message will be displayed to user. For instance, I want to throw a ValidationException in response to an input parameter.

What I did:
So I declared my RemoteInterface as throwing both RemoteException & CommonException. ValidationException is a subclass of CommonException which in turn is a subclass of java.lang.Exception. Hence they are all serializable.
That is,
java.lang.Exception
|
+--mypackage.CommonException
  |
  +--mypackage.ValidationException

and
public businessMethod(serializable input)
throws RemoteException, CommonException;

Problem:
When I throw my ValidationException from the session bean, it travels back to the client where I get the following:

java.rmi.UnexpectedException: Undeclared checked exception;

Now, I've checked that the Exception classes etc are on the classpath & it is not a ClassNotFoundException either. I read somewhere (don't remember where :-()that if I have multiple business exceptions, I can declare my business method to throw just the superclass.

i.e instead of having my method declared as
public businessMethod(serializable input)
throws RemoteException, ValidationException, InvalidInputException, etc etc...

just have
throws CommonException;


Could someone help me understand what the problem is here?
Thanks for your help.
--Das