Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how application client knows about bean?

 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please follow this link: http://java.sun.com/javaee/5/docs/tutorial/doc/bnbnj.html

Look at the code of application client that access the bean.

Note: Application clients are the clients which are not deployed in same JVM.



Above code (annotation) specify that this client is for "Converter bean" (ConverterBean bean and Converter interface).

My confusion is, how does JVM know about this Converter??? Where it is deployed???

Thanks.
 
Francois-Xavier Douxchamps
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is the black magic of EJB 3...

In fact during deployment of the EJB and the client, the container replaces the annotation by a jndi lookup using the name of the instance variable to locate an EJB... If no EJB is found you will have a NullPointerException using the instance variable.
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Francois-Xavier Douxchamps:
That is the black magic of EJB 3...

In fact during deployment of the EJB and the client, the container replaces the annotation by a jndi lookup using the name of the instance variable to locate an EJB... If no EJB is found you will have a NullPointerException using the instance variable.


But where does container will look up???
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The container is looking for it as a JNDI addressable resource with the given name.

-Cameron McKenzie
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic