Which exception can result from the invocation on line 100?

A stateless session bean FooBean implements an asynchronous business method foo() on its
bean class:
@Asynchronous
public void foo() ( )
The asynchronous business method is exposed through a remote business interface FooRemote.
A caller acquires an EJB reference to this bean and invokes it as follows:
100. fooRemoteRef.foo();
Which exception can result from the invocation on line 100?

A stateless session bean FooBean implements an asynchronous business method foo() on its
bean class:
@Asynchronous
public void foo() ( )
The asynchronous business method is exposed through a remote business interface FooRemote.
A caller acquires an EJB reference to this bean and invokes it as follows:
100. fooRemoteRef.foo();
Which exception can result from the invocation on line 100?

A.
java.rmi.RemoteException

B.
java.util.concurrent.ExecutionException

C.
javax.ejb.EJBException

D.
java.lang.IllegalArgumentException

Explanation:
Note:
*RemoteRef represents the handle for a remote object. A RemoteStub uses a remote reference to
carry out a remote method invocation to a remote object.
*invoke
public Object invoke(Remote obj,

Method method,
Object[] params,
long opnum)
throws Exception
Invoke a method. This form of delegating method invocation to the reference allows the reference
to take care of setting up the connection to the remote host, marshaling some representation for
the method and parameters, then communicating the method invocation to the remote host. This
method either returns the result of a method invocation on the remote object which resides on the
remote host or throws a RemoteException if the call failed or an application-level exception if the
remote invocation throws an exception.
Parameters:



Leave a Reply 4

Your email address will not be published. Required fields are marked *


Oscar

Oscar

A. EJBException only for local invoke.

Figaro

Figaro

C.
The methods of the business interface typically do not throw the java.rmi.RemoteException, regardless of whether the interface is a remote or local interface.
If the container catches a non-application exception, it throws an EJBException, or if the web service client view is used, a RemoteException.