• 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 ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Found mistakes in Enthuware Question Bank

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

Today when i was taking mock test from Enthuware I found 2 mistakes, please tell me if I am wrong.

1)

@Stateless
@Remote(Easy.class)
public class EasyBean {
public void doIt() throws MyException{
if(true) throw new MyException();
}
}

The code for MyException is as follows -

public class MyException extends Exception{ }

If a client calls doIt() method on EasyBean (assuming that it is declared in the remote interface), what will happen?

The client will get RemoteException.
The client will get EJBException.
The client will get MyException.
The client will get NullPointerException.
The client will get EJBException that wraps MyException.In the above question the bean is not implimenting the interface, so i marked as EJBException. So please clarify my doubt.

2)

Consider the following code for a session bean class:

//... valid cdoe
//Line 1: insert code here
public class TellerBean implements
com.enthu.ejbplus.TellerRemote, com.enthu.ejbplus.TellerLocal {

// ... valid code
}

This bean sends messages to a Queue in its business methods. Which of the following line of code should be inserted at // Line 1 to declare a TYPE-level dependency on the JMS Queue?
(Assume appropriate import and other necessary statements.)

@Resource
Queue myQueue;

@Resource
private static Queue myQueue;

@Resource(name="jms/myQueue", type=javax.jms.Queue.class)
@Resource(name="jms/Queue")

Queue myQueue;

The answer given by Enthuware is in bold but there is one more question below that is contredicting the above question.

Consider the following code for a session bean class:

//... valid code
public class TellerBean implements
com.enthu.ejbplus.TellerRemote, com.enthu.ejbplus.TellerLocal {
//Line 1: insert code here
}
}

This bean sends messages to a Queue in its methods. Which of the following line of code should be inserted at // Line 1 to inject a Queue object?
(Assume appropriate import and other necessary statements.)


@Resource private Queue myQueue; c

@Resource private static Queue myQueue;

@Resource(name="jms/myQueue", type=javax.jms.Queue.class)
A variable is required. It would have been valid if it were put before the class definition.

@Resource(name="jms/Queue")
Queue myQueue;

If the name is not specified, a default name is assumed which is generated using the complete class name prependend to the field name i.e. com.enthu.ejbplus.TellerBean/myQueue

@Resource public final Queue myQueue;

Please tell me if i am wrong.

Regards
Vasanthi
 
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For Q1

@Remote(Easy.class) is one of the polymorphic way to implements business interface
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic