Valid 1Z0-895 Dumps shared by ExamDiscuss.com for Helping Passing 1Z0-895 Exam! ExamDiscuss.com now offer the newest 1Z0-895 exam dumps, the ExamDiscuss.com 1Z0-895 exam questions have been updated and answers have been corrected get the newest ExamDiscuss.com 1Z0-895 dumps with Test Engine here:
Which is a correct way to define a runtime exception as an EJB 3.x application exception?
Correct Answer: B
Explanation/Reference: Use the @javax.ejb.ApplicationException annotation to specify that an exception class is an application exception thrown by a business method of the EJB. The EJB container reports the exception directly to the client in the event of the application error. Note: java.lang.Object java.lang.Throwable java.lang.Exception java.lang.RuntimeException javax.ejb.EJBException javax.ejb public class EJBException extends java.lang.RuntimeException The EJBException is thrown to report that the invoked business method or callback method could not be completed because of an unexpected error (e.g. the instance failed to open a database connection). Example: The following ProcessingException.javafile shows how to use the @ApplicationExceptionannotation to specify that an exception class is an application exception thrown by one of the business methods of the EJB: package examples; import javax.ejb.ApplicationException; / ** * Application exception class thrown when there was a processing error * with a business method of the EJB. Annotated with the * @ApplicationException annotation. * / @ ApplicationException() public class ProcessingException extends Exception { Reference: Programming WebLogic Enterprise JavaBeans, Version 3.0 programming Application Exceptions