aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes What is the meaning of this Enthuware's answer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "What is the meaning of this Enthuware Watch "What is the meaning of this Enthuware New topic
Author

What is the meaning of this Enthuware's answer

Chaminda Amarasinghe
Ranch Hand

Joined: May 17, 2006
Posts: 402
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 ]
Paul Anilprem
Enthuware Software Support
Ranch Hand

Joined: Sep 23, 2000
Posts: 3204
    
    2
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.


Enthuware - Best Mock Exams and Questions for Oracle/Sun Java Certifications
Quality Guaranteed - Pass or Full Refund!
Chaminda Amarasinghe
Ranch Hand

Joined: May 17, 2006
Posts: 402
Hi Anil,

Thanks for the help,
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What is the meaning of this Enthuware's answer
 
Similar Threads
A question in exception handling
ArithmeticException
Question on exception handling
Application Exception in MDB
Need Explanation..