• Post Reply Bookmark Topic Watch Topic
  • New Topic

a mock question

 
chao cai
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
13. Given the following onMessage() method of a message-driven bean (Assume that all necessary imports have been made, that Bean is the component interface type of a stateless session bean and BeanHome is its home interface):
public void onMessage(javax.jms.Message msg) {
Context initCtx = new InitialContext();
Object result = initCtx.lookup("java:comp/env/ejb/Bean");
BeanHome beanHome = (BeanHome) PortableRemoteObject.narrow(result,
BeanHome.class);
//do something with beanHome.
}
Select all the correct statements:
A. The code will not compile. The onMessage() method if a message-driven bean may throw any application exception.
B. The code compiles fines.
C. The code should be enclosed in a try-catch block.
D. The onMessage() method declaration does not satisfy the requirements of the EJB 2.0 specification.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!