7.6. JNDI and EJB

JNDI is important in EJB technology, because an EJB will use JNDI to look up all its configuration information, get access to resources like databases, and locate other EJBs. EJB clients that are not themselves EJBs also use JNDI to get access to EJBs. EJBs increasingly use JNDI to obtain application data as well.

Why did the EJB designers stipulate the use of JNDI for these purposes? It is possible to envisage other, perhaps more elegant, methods, after all. Essentially, JNDI already exists, and can do all the things that an EJB name lookup service needs; it seemed unnecessary to implement another naming API just for EJB servers.

The vendor of an EJB product can use whatever naming server it likes to store information that ...

Get Applied Enterprise JavaBeans™ Technology now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.