Hi
I am newbie to EJB. I was reading doc of EJB and in FinderException it says that it is an Application level Exception.
I know the meaning of application level exception.
My question is this, is it necessary to implement Serializable interface for app level exception?
If yes then WHY?
If no then why FinderException is implementing it?
Thanks in advance.
Discussions
EJB programming & troubleshooting: Application level exception and Serializable interface
-
Application level exception and Serializable interface (2 messages)
- Posted by: Ravish Singh
- Posted on: February 24 2003 02:38 EST
Threaded Messages (2)
- Application level exception and Serializable interface by Gal Binyamini on February 24 2003 12:20 EST
- Application level exception and Serializable interface by Ravish Singh on February 25 2003 09:10 EST
-
Application level exception and Serializable interface[ Go to top ]
- Posted by: Gal Binyamini
- Posted on: February 24 2003 12:20 EST
- in response to Ravish Singh
All Throwables, including all types of exceptions, are Serializable. Your application exceptions should be runtime-serializable, meaning they should either reference only other runtime-serializable objects or define their own serialization mechanism. In my expirience this is hardly ever an issue. I don't recall ever having to deal with serialization of exceptions myself.
The reason exceptions (application and system) should be serializable is that when they are thrown from a method, they are passed back to the client. The way to pass them, like method parameters and return values, is serialization. This is a general RMI (and RMI-IIOP) rule, not an EJB-specific rule.
Gal -
Application level exception and Serializable interface[ Go to top ]
- Posted by: Ravish Singh
- Posted on: February 25 2003 09:10 EST
- in response to Gal Binyamini
thanks !
I never noticed that Throwable implements Serializable.