Hey Kuo-Feng Sun,
Application exceptions are always checked exceptions. These are exceptions that the client expects to happen and can deal with. Checked exceptions must be either caught or thrown and the compiler will always ensure this. Some examples are CreateException, FinderException and RemoveException. A bean provider can also define his own application exceptions by extending Exception or one of the checked exceptions except for RemoteException.
System exceptions are always runtime exceptions, except for RemoteException which is a checked exception. System exceptions indicate that something unrecoverable happened on the server. The compiler will not check for handling of these exceptions. If the container recieves a runtime exception from a bean it will rethrow it to a remote client as a RemoteException or to a local client as an EJBException. The container will also rollback the transaction, log the exception and kill the bean. Some examples of runtime exceptions related to EJBs are NoSuchObjectException, TransactionRequiredException and
IllegalStateException.
Refer to Head First
EJB for a more in-depth coverage of exceptions.
Hope this helps.
[ January 29, 2004: Message edited by: Keith Rosenfield ]
[ January 29, 2004: Message edited by: Keith Rosenfield ]