Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

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:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic