When you (the client) want a reference to a home interface, you go through JNDI. The process is pretty straightforward: you give JNDI a logical name (the name the deployer told the server to use), and you get back something that implements the home interface.
JNDI stands for Java Naming and Directory Interface, and it’s an API for accessing naming and directory services. Although JNDI is quite powerful, there are only a few pieces of it you need to know for EJB—how clients find it, how clients use it, how beans use it, and how to put things into it.
The JNDI API can work with many different services, as long as that service has a JNDI driver (called a Service Provider). It’s a lot like JDBC, where you (the developer) use the JDBC API to send SQL statements to a variety of different databases. The JNDI driver translates the method calls you make on the JNDI API into something the underlying naming/directory service understands.
Getting the home interface stub
Get an InitialContext
Context ic = new InitialContext();
The InitialContext (a subtype of Context) is your entry point ...