Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

a mock question

Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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,
//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.
snakes are really good at eating slugs. And you wouldn't think it, but so are tiny ads:
We need your help - Coderanch server fundraiser
    Bookmark Topic Watch Topic
  • New Topic