Win a copy of Machine Learning with TensorFlow this week in the Artificial Intelligence and Machine Learning forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

What is the meaning of this Enthuware's answer

 
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

Here is one of correct answer (according to enthu) for a question of enthu-ejb+ (Test 3, Q 23)

If it is a checked exception that is not listed in the throws clause of the method and if the bean cannot recover from this exception, the bean method should throw the javax.ejb.EJBException that wraps the original exception.


Dear Paul Anil, Can you (or your exam development team) please teach me how a method can throw checked exception without defining in throws clause.

Thanks
[ November 12, 2008: Message edited by: Chaminda Amarasinghe ]
 
Enthuware Software Support
Posts: 4509
44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Chaminda,
It will make sense if you read it in the presepective of what the question is asking, "What is the responsibility of the bean provider if his session bean method gets an exception during execution of its method body?"

Code within the method of a session bean may throw either a checked or an unchecked exception. It is not necessary that all the checked exceptions that are received while executing the method body are listed in the throws clause of the method. You can also put such a piece of code in a try-catch block. This is the scenario that the option you refered to is talking about. If you, as a bean developer, believe that such an exception is detrimental to the bean process and if you don't want to list that exception in the throws clause, you shoul throw an EJBException that wraps the original exception.

If you (or any one else readin this) have any thoughts how to reconstruct the option to avoid such confusion, please do share. We will really appreciate your feedback.

HTH,
Paul.
 
Chaminda Amarasinghe
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Anil,

Thanks for the help,
 
Danger, 10,000 volts, very electic .... tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic