aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Found mistakes in Enthuware Question Bank Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Found mistakes in Enthuware Question Bank" Watch "Found mistakes in Enthuware Question Bank" New topic
Author

Found mistakes in Enthuware Question Bank

Vasanthi hiremath
Ranch Hand

Joined: May 05, 2009
Posts: 35
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
Lee Kian Giap
Ranch Hand

Joined: Jan 23, 2008
Posts: 213
For Q1

@Remote(Easy.class) is one of the polymorphic way to implements business interface


SCJP 6, SCWCD 5, SCBCD 5
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Found mistakes in Enthuware Question Bank