Previous | Next | Trail Map | Tips for LDAP Users | Comparison of the LDAP and JNDI Models

LDAP Status Codes and JNDI Exceptions

The LDAP defines a set of status codes that are returned with LDAP responses sent by the LDAP server (see RFC 2251). In the JNDI, error conditions are indicated as checked exceptions that are subclasses of NamingException(in the API reference documentation). See The Basics (in the Basics trail) trail for an overview of the JNDI exception class hierarchy.

The LDAP service provider translates the LDAP status code it receives from the LDAP server to the appropriate subclass of NamingException. The following table shows the mapping between LDAP status codes and JNDI exceptions.

LDAP Status Code Meaning Exception or Action
0 Success Report success.
1 Operations error NamingException(in the API reference documentation)
2 Protocol error CommunicationException(in the API reference documentation)
3 Time limit exceeded. TimeLimitExceededException(in the API reference documentation)
4 Size limit exceeded. SizeLimitExceededException(in the API reference documentation)
5 Compared false. Used by DirContext.search()(in the API reference documentation). Does not generate an exception.
6 Compared true. Used by DirContext.search()(in the API reference documentation). Does not generate an exception.
7 Authentication method not supported. AuthenticationNotSupportedException(in the API reference documentation)
8 Strong authentication required. AuthenticationNotSupportedException(in the API reference documentation)
9 Partial results being returned. If the environment property "java.naming.referral" is set to "ignore" or the contents of the error do not contain a referral, throw a PartialResultException(in the API reference documentation). Otherwise, use contents to build a referral.
10 Referral encountered. If the environment property "java.naming.referral" is set to "ignore", then ignore. If the property is set to "throw", throw ReferralException(in the API reference documentation). If the property is set to "follow", then the LDAP provider processes the referral. If the "java.naming.ldap.referral.limit" property has been exceeded, throw LimitExceededException(in the API reference documentation).
11 Administrative limit exceeded. LimitExceededException(in the API reference documentation)
12 Unavailable critical extension requested. OperationNotSupportedException(in the API reference documentation)
13 Confidentiality required. AuthenticationNotSupportedException(in the API reference documentation)
14 SASL bind in progress. Used internally by the LDAP provider during authentication.
16 No such attribute exists. NoSuchAttributeException(in the API reference documentation)
17 An undefined attribute type. InvalidAttributeIdentifierException(in the API reference documentation)
18 Inappropriate matching InvalidSearchFilterException(in the API reference documentation)
19 A constraint violation. InvalidAttributeValueException(in the API reference documentation)
20 An attribute or value already in use. AttributeInUseException(in the API reference documentation)
21 An invalid attribute syntax. InvalidAttributeValueException(in the API reference documentation)
32 No such object exists. NameNotFoundException(in the API reference documentation)
33 Alias problem NamingException(in the API reference documentation)
34 An invalid DN syntax. InvalidNameException(in the API reference documentation)
35 Is a leaf. Used by the LDAP provider; usually doesn't generate an exception.
36 Alias dereferencing problem NamingException(in the API reference documentation)
48 Inappropriate authentication AuthenticationNotSupportedException(in the API reference documentation)
49 Invalid credentials AuthenticationException(in the API reference documentation)
50 Insufficient access rights NoPermissionException(in the API reference documentation)
51 Busy ServiceUnavailableException(in the API reference documentation)
52 Unavailable ServiceUnavailableException(in the API reference documentation)
53 Unwilling to perform OperationNotSupportedException(in the API reference documentation)
54 Loop detected. NamingException(in the API reference documentation)
64 Naming violation InvalidNameException(in the API reference documentation)
65 Object class violation SchemaViolationException(in the API reference documentation)
66 Not allowed on non-leaf. ContextNotEmptyException(in the API reference documentation)
67 Not allowed on RDN. SchemaViolationException(in the API reference documentation)
68 Entry already exists. NameAlreadyBoundException(in the API reference documentation)
69 Object class modifications prohibited. SchemaViolationException(in the API reference documentation)
71 Affects multiple DSAs. NamingException(in the API reference documentation)
80 Other NamingException(in the API reference documentation)

Comparison of the LDAP and JNDI Models: End of Lesson

What's next? Now you can:


Previous | Next | Trail Map | Tips for LDAP Users | Comparison of the LDAP and JNDI Models