wood burning stoves 2.0*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes mock questions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "mock questions" Watch "mock questions" New topic
Author

mock questions

Ankit Doshi
Ranch Hand

Joined: Dec 04, 2002
Posts: 222
Q1. Which two must a bean provider supply for each enterprise bean in the deployment descriptor?
A. Security roles
B. JNDI name of the enterprise bean
C. enterprise bean type: session, entity or message-driven
D. Value of transaction attribute for home and component interface methods.
E. Fully qualified name of the class that implements the enterprise bean's business methods.

Correct answers given are C & E. Why not B?


Q2. What can the bean provider do if the onMessage method encounters application exception (Choose two).
A. Add application exception to method's throws clause.
B. handle exception in method; do not throw the exception
C. wrap and rethrow exception as EJBException
D. wrap and rethrow exception as RemoteException

Question asks for two answers, but I think only one option B is valid.


Q3. Which describes an action that is most appropriate for an Application Assembler to perform?
A. link an enterprise bean reference to a target enterprise bean.
B. bind resource environment reference to actual resource
C. bind resource manager connection factory reference to actual resource factory
D. bind UserTransaction interface to enterprise beans that can use that interface


Q4. Given following code for EB:
public interface ABCHome extends EJBHome {
//some code
public float livingIndex(String state, float salary) throws RemoteException;
//more code
}
Which stmt is true?
A. The livingIndex method is illegal.
B. The livingIndex method is EJB 2.0 compliant.
Balaji Anand
Ranch Hand

Joined: Nov 03, 2004
Posts: 146
Q1. JNDI name is given by the deployer not the bean provider.

Q2.Option C is also correct
Ankit Doshi
Ranch Hand

Joined: Dec 04, 2002
Posts: 222
Q2.Option C is also correct


What is the point of throwing the EJBException to the container?
Rahul Mishra
Ranch Hand

Joined: Jan 22, 2006
Posts: 211
Q1. Which two must a bean provider supply for each enterprise bean in the deployment descriptor?
A. Security roles No.Job of Assembler/DeployerB. JNDI name of the enterprise bean No.Given by deployerC. enterprise bean type: session, entity or message-driven Yes.A must to ensure target compatibility laterD. Value of transaction attribute for home and component interface methods. May be, based on EJB Specs..he does.E. Fully qualified name of the class that implements the enterprise bean's business methods. Yes, is a better option than D
Correct answers given are C & E. Why not B?

When you get such options, always pick primary roles first.If you have two options and you get two primary role based answers.Home Run.Otherwise D could be an answer as well.Hope you get the idea.

Q2. What can the bean provider do if the onMessage method encounters application exception (Choose two).
A. Add application exception to method's throws clause.
B. handle exception in method; do not throw the exception Yes
C. wrap and rethrow exception as EJBException Yes
D. wrap and rethrow exception as RemoteException

Question asks for two answers, but I think only one option B is valid.

Thrown an EJB Exception, since its a system Exception.Let the bean die. Why do you care? I may not necessarily throw the Exception back to the client if i throw an EJB Exception from my bean
But remember if there was one option i would go only for B.


Q3. Which describes an action that is most appropriate for an Application Assembler to perform?
A. link an enterprise bean reference to a target enterprise bean. Yes
B. bind resource environment reference to actual resource No.Deployer work C. bind resource manager connection factory reference to actual resource factory Again, Deployer work
D. bind UserTransaction interface to enterprise beans that can use that interface No. Server does this while bootstrap

Q4. Given following code for EB:
public interface ABCHome extends EJBHome {
//some code
public float livingIndex(String state, float salary) throws RemoteException;
//more code
}
Which stmt is true?
A. The livingIndex method is illegal.
B. The livingIndex method is EJB 2.0 compliant. Its perfectly legal, i think. All your attributes are serialable.So no marshalling issues identified.
[ April 26, 2006: Message edited by: Rahul Mishra ]

OCMJEA/SCEA, SCDJWS, SCBCD 1.3, SCJP 1.4
My SCEA experience:http://javalogue.blogspot.com/
Balaji Anand
Ranch Hand

Joined: Nov 03, 2004
Posts: 146
If the Message Acknowledgement is tied to the method completion throwing a runtime exception results in the message going back to the queue.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: mock questions
 
Similar Threads
To Nikhil Pendharkar for IBM 287
J2EE Qtns (Urgent)
Mock Questions
Mock question
IBM 287 ICE TEST