JNDI Frequently Asked Questions



Who should use JNDI?

Any Java application that needs to access information about users, machines, networks, and services. User information includes security credentials, phone numbers, electronic and postal mail addresses, and application preferences. Machine information includes network addresses, machine configurations, etc. In addition, any Java application that needs to either export objects or access objects exported by other applications and services. Examples include printers, calendars, and networked file systems.

Can I use JNDI now?

Yes, Sun Microsystems has released JNDI as a Java Standard Extension. Sun Microsystems has also released service providers that plug in seamlessly behind JNDI for a number of naming and directory services: LDAP, NIS, CORBA (COS) Naming, and files. These and service providers produced by other vendors are available for download.

Where is JNDI being used in the Java platform?

HotJava Views 1.1 is using JNDI to access LDAP. Enterprise APIs such as Enterprise JavaBeans, Java Message Service, JDBC 2.0 make use of JNDI to for their naming and directory needs. RMI over IIOP applications can use JNDI to access the CORBA (COS) naming service.

Who will provide implementations of JNDI?

At the time of this writing, IBM, Novell, Sun, and WebLogic have produced service providers for JNDI. We maintain a listing of publicly available service providers.

What protocols does JNDI provide an interface to?

JNDI itself is independent of any specific directory access protocol. Individual service providers determine the protocols to support. There will be provider implementations for popular protocols, such as LDAP, NDS, DNS, and NIS(YP), supplied by different vendors.

How does JNDI relate to LDAP?

JNDI provides an excellent object-oriented abstraction of directory and naming. Developers using JNDI can produce queries that use LDAP or other access protocols to retrieve results; however, they are not limited to LDAP nor do they have to develop their applications wired to LDAP. JNDI supports the key capabilities in LDAP v3.

How does JNDI relate to Netscape's Java LDAP API?

JNDI is a generic directory API for Java programs. It is analogous to the java.io.File class for accessing files. There might be some administrative programs that need to manipulate a file at the protocol level (such as NFS), but typically all Java applications use the File class to access to file system. Similarly, most Java programs should use JNDI to access directories. Applications that need to manipulate directory content at the protocol level may choose to use Netscape's API.

How does JNDI relate to OMG's CORBA standards for naming?

A Java CORBA application can use JNDI to access to the CORBA (COS) name service, as well as other naming and directory services. It offers the application one interface for accessing all these naming and directory services.

Using JNDI also paves the way for Java CORBA applications to use a distributed enterprise-level service like LDAP to store object references.

How does JNDI relate to Microsoft's ADSI?

The Java ADSI package allows Java programs to access Active Directory based on the COM model. Although it can be used to access other directories, it is a Windows-centric solution.

JNDI offers Java applications, regardless of whether they're running on Windows or accessing Active Directory, to access directories using the Java object model. For example, you can manipulate objects such as AWT and JavaBeans components, bind them into the directory, and look them back up without having to do any translation or deal with data representation issues.

What is XFN and how does this relate to JNDI?

XFN is X/Open Federated Naming, a C-based standard for accessing multiple, possibly federated naming and directory services. A programmer familiar with XFN will find it easy to use JNDI.

What about security?

Different directories have different ways of dealing with security. JNDI allows for applications to work in conjunction with directory-specific security systems. In the future, JNDI-based applications will be able to take advantage of any single sign-on mechanism developed for the Java platform.


Though we value your input, before you send feedback, please review our pages of Frequently Asked Questions (FAQ). Please note that due to the volume of messages we receive, we typically do not respond to individual messages.
Left Curve
Java SDKs and Tools
Right Curve
Left Curve
Java Resources
Right Curve
JavaOne Banner
Java 8 banner (182)