• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Entity bean - NameNotFoundException

 
Vishwa Kumba
Ranch Hand
Posts: 1066
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A sample mock question:
When a CMP entity bean tries to access the javax.transaction.UserTransaction thru a JNDI lookup,
then it would result which exception?
A. javax.Naming.NameNotFoundException
B. IllegalStateException
Answer: javax.Naming.NameNotFoundException
Is that correct?
[ December 30, 2003: Message edited by: Vish Kumar ]
 
Kathy Sierra
Cowgirl and Author
Rancher
Posts: 1589
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy, offhand, I do not know the answer to this, and in fact, I do not know if the type of exception is specified in the EJB spec (and I haven't tried it). But if it is NOT defined in the spec, then it is not a valid question (and I *can* tell you that this is not in the exam! )
Perhaps someone else has found this in the specification, but I am not aware of it, and for the purpose of the exam, I would not worry about this particular scenario.
cheers,
kathy
 
Vishwa Kumba
Ranch Hand
Posts: 1066
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Kathy,
As long as it is not in the exam, I am fine...
I found this Q in SoftLearn-Systems mock exam and wasn't sure.
Out of curiosity, now I tried to search for the word namenotfoundexcetpion
in the spec and to my surprise, I came up with this...
page: 431, 20.7
"The Container must not make the UserTransaction interface available to the enterprise beans that are not allowed to use this interface. The Container should throw javax.naming.NameNotFoundException if an instance of an enterprise bean that is not allowed to use the UserTransaction
interface attempts to look up the interface in JNDI." :roll:
[ December 30, 2003: Message edited by: Vish Kumar ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic