• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Application Exception

 
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can an application exception extend from javax.ejb.EJBException class?
 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
an EJBException is a system Exception which is a subclass of RuntimeException. all EJBExceptions are system based exceptions and hence application exceptions cannot extend them. An application exception can become a system exception if you dont annotate it with @ApplicationException.
 
Ranch Hand
Posts: 393
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think yes, Application Exception are those that extend exception. System exceptions are also application exception if they are annoated with @ApplicationException. System exceptions are nothing but something that extends runtime Exception. EJB Exception extends Runtime Exception. So I think you could extend EJBException & annotate with @AppException.

Can someone confirm this.

@ApplicationException
Public MyException extends EJBException {
}
 
Aditya Vasudeva
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
its difficult to say this will work or not because nothing as such is mentioned in the specs...you can test it to find out...most probably it will not work.
 
nitin pai
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In my opinion it should be yes, since Application exceptions can extend RuntimeException and EJBException is also a subclass of RuntimeException.

However I want to confirm it since it is not mentioned in the specs and there was a similar question in the Enthuware mocks. But trying out won't give a clear answer since vendor implementations differ.

If it has not been mentioned in the specs then I hope it won't be asked in the exam too, because we don't have a clear answer for it.
 
I can't beleive you just said that. Now I need to calm down with this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic