Which of the following is True about business interface of an EJB 3.0 bean? (Choose two) (Choose 2)
[A] The interface must not extend javax.ejb.EJBObject or javax.ejb.EJBLocalObject interfaces.
[B] The remote business interface must implement the java.rmi.Remote interface.
[C] The throws clause of the remote business interface method must throw java.rmi.RemoteException
[D] It is not mandatory to define whether the business interface is a Remote or Local interface
The correct answers are A and D.
It is correct, but why answer [C] is wrong?
And, the explanation says:
The EJB 3.0 specification mandates that the methods of the business interface must not throw java.rmi.RemoteException.
Is this correct? I don't remember anything like this from the specs.
In EJB2 it was true where every method in the endpoint interface must declare the java.rmi.RemoteException in its throws clause. This exception is used for reporting network problems by using the method.
With EJB3 the container will add this exception to the method so the developer doesn't have to do this in the code. This is done for making the development of EJB more easy.