• Post Reply Bookmark Topic Watch Topic
  • New Topic

exceptions can be received by the caller when invoking a Remote Method inside the Bean class  RSS feed

 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

This is a question from EJB 3 Quiz : Here i am having a query

Given the following Remote business interface:

@Remote
public interface Hello {
public String hello();
}
Which exceptions can be received by the caller as a result of invoking the hello() method?

A. javax.ejb.EJBException
B. java.rmi.RemoteException
C. A and B
D. None of the above.

Please let me know what will be the answer for this
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 37256
519
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you think the answer is and why? The goal here is for you to learn not for someone to hand you the answer. Looking it up and checking if you are right will be much more educational.
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would answer D for it .

As per my understanding a Method can throw only ApplicationException if needed and not mantadatory to handle SystemExceptions .


I know that you should not try to throw RemoteException from your beans methods.

But can you please tell me what happens when it encounters a RuntimeException .
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!