Exception handling in EJB, JAVA Programming

Java has two kinds of exceptions:

1. Checked exception: handled from java.lang.Exception but not java.lang.RuntimeException.

2. Unchecked exception: handled from java.lang.RuntimeException thrown by JVM.

 

1273_Exception handling in EJB.png

 

EJB has two kinds of exceptions:

1. System   Exception :   is   an   unchecked   exception produced   from java.lang.RuntimeException.   An EJBException is an unchecked exception, which is started from java.lang.RuntimeException.

2. Application Exception : is generic to an application and thrown because of violation of business rules. An Application Exception is a checked exception that is either described by the bean developer and does not import java.rmi.RemoteException.

A  System  Exception  is  given  by  the  system  and  is  not  recoverable. Because the System Exceptions are unpredictable when they occur, the EJB container is the only one responsible for trapping the System Exceptions. The container usually wraps any RuntimeException in RemoteException, which subsequently puts thrown to the caller. In addition to intercepting System Exception the container can give the errors.

 

Posted Date: 7/27/2012 4:26:31 AM | Location : United States







Related Discussions:- Exception handling in EJB, Assignment Help, Ask Question on Exception handling in EJB, Get Answer, Expert's Help, Exception handling in EJB Discussions

Write discussion on Exception handling in EJB
Your posts are moderated
Related Questions
Give the example of mixing data type in java? Mixing Data Types Order can form a difference while data types are mixed. For example, 1 / 2 * 3.5 = 0.0 3.5 * 1 / 2 = 1.75 3.5 /

1) Around : org.aopalliance.intercept.MethodInterceptor 2) Before : org.springframework.aop.BeforeAdvice 3)  After : org.springframework.aop.AfterReturningAdvice 4) Throws

Staging areas that have messages those have been sent and are waiting to be read. Note that, contrary to what the name queue suggests, messages don't have to be delivered in the or

Question: (a) Explain the event handling mechanism using a 'JComboBox' as example. Your answer must clearly indicate the event source, event object and event listener. Also

* Using a data structure to represent a set * Writing and using a checked exception * Extending the Exception class What should you upload via Blackboard? The files,

Explain the Remainder or Modulus Operator in Java? Java has one significant arithmetical operator you might not be familiar with, %, also called as the modulus or remainder ope

A bean factory is fine to easy applications, but to take benefit of the full power of the Spring framework, you may require to move up to Springs more advanced container, the appli

What 'System.out.println()' signifies? 'System' is a predefined class. System class gives access to the system. 'out' is the output stream. 'println' is printin

Too many function invocations between the server and the client will lead to network overhead, tight coupling due to dependencies between the server and the client, misuse of serve

Q. Write the method to define the packages in java programme. Explain. Ans. Package: When we work on a project we have to break our programme in several classes. To organize