| Author |
Extending EJB Exception
|
Nikhil Jain
Ranch Hand
Joined: May 15, 2005
Posts: 383
|
|
Is it possible to extend an exception from EJBException & still be an ApplicationException For ex @ApplicationExcetion public class MyException extends EJBException{ } Technical this should be possible as EJBException extends RuntimeException. But in one of the mock exams the above concept seems to incorrect
|
SCJP 1.4, SCWCD 1.4, SCBCD 1.5
|
 |
Benoît de Chateauvieux
Ranch Hand
Joined: Aug 10, 2007
Posts: 183
|
|
Hi Anu Tilwalli, I read in the specs (14.1.1):
So, I think that a subclass of EJBException annotated as ApplicationExcetion will be an application exception. But I've just tested it with my JBoss. I have created this Bean: And the exception: When it extends Exception, I don't see the destroy in the console. --> It's an application exception When it extends EJBException appears a "[STDOUT] Destroyed". --> It's a system exception. So, the theory says that you can extends EJBException but the reality shows that it's not true. Beno�t
|
SCJP5 | SCBCD5 | SCEA5 Part 1
|
 |
 |
|
|
subject: Extending EJB Exception
|
|
|