Skip navigation.
Downloads | Product Documentation | Support

Programming WebLogic JNDI

# Introduction to WebLogic JNDI

The following sections present an overview of the Java Naming and Directory Interface (JNDI) implementation in WebLogic Server including:

- What is JNDI? on page 1-1
- WebLogic Server JNDI on page 1-1

# What is JNDI?

Applications use naming services to locate objects in data sources, EJBs, JMS, MailSessions, and so on in the network. A naming service associates names with objects and finds objects based on their given names. (The RMI registry is a good example of a naming service.)

JNDI provides a common-denominator interface to many existing naming services, such as LDAP (Lightweight Directory Access Protocol) and DNS (Domain Name System). These naming services maintain a set of bindings, which relate names to objects and provide the ability to look up objects by name. JNDI allows the components in distributed applications to locate each other.

JNDI is defined to be independent of any specific naming or directory service implementation. It supports the use of a number of methods for accessing various new and existing services. This support allows any service-provider implementation to be plugged into the JNDI framework using the standard service provider interface (SPI) conventions.

# WebLogic Server JNDI

The WebLogic Server implementation of JNDI supplies methods that:

- Give clients access to the WebLogic Server naming services
- Make objects available in the WebLogic namespace
- Retrieve objects from the WebLogic namespace

Each WebLogic Server cluster is supported by a replicated cluster-wide JNDI tree that provides access to both replicated and pinned RMI and EJB objects. While the JNDI tree representing the cluster appears to the client as a single global tree, the tree containing the cluster-wide services is actually replicated across each WebLogic Server in the cluster. For more information, see Using WebLogic JNDI in a Clustered Environment.

Other WebLogic services can use the integrated naming service provided by WebLogic Server JNDI. For example, WebLogic RMI can bind and access remote objects by both standard RMI methods and JNDI methods.

In addition to the standard Java interfaces for JNDI, WebLogic Server provides its own implementation, `weblogic.jndi.WLInitialContextFactory`, that uses the standard JNDI interfaces.

You need not `instantiate this class directly. Instead,` you can use the standard `javax.naming.InitialContext` class and set the appropriate hash table properties, as documented in the section Setting Up JNDI Environment Properties for the InitialContext. All interaction is done through the `javax.naming.Context` interface, as described in the JNDI Javadoc.

For instructions on using the WebLogic JNDI API for client connections, see WebLogic JNDI.