Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

mock questions

 
Ankit Doshi
Ranch Hand
Posts: 222
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Q1. JNDI name is given by the deployer not the bean provider.

Q2.Option C is also correct
 
Ankit Doshi
Ranch Hand
Posts: 222
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Q2.Option C is also correct


What is the point of throwing the EJBException to the container?
 
Rahul Mishra
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Balaji Anand
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the Message Acknowledgement is tied to the method completion throwing a runtime exception results in the message going back to the queue.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic