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 the 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 Compare false Used by DirContext.search()(in the API reference documentation). Does not generate an exception.
6 Compare 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 If the environment property "java.naming.referral" is "ignore", or contents of error do not contain a referral, throw PartialResultException(in the API reference documentation). Otherwise, use contents to build a referral.
10 Referral If the environment property "java.naming.referral" is "ignore", ignore. If the environment property "java.naming.referral" is "throw", throw ReferralException(in the API reference documentation). If the environment property "java.naming.referral" is "follow", the LDAP provider processes the referral. If "java.naming.ldap.referral.limit" has been exceeded, throw LimitExceededException(in the API reference documentation).
11 Administrative limit exceeded LimitExceededException(in the API reference documentation)
12 Unavailable critical extension OperationNotSupportedException(in the API reference documentation)
13 Confidentiality required AuthenticationNotSupportedException(in the API reference documentation)
14 SASL bind in progress Used internally by LDAP provider during authentication.
16 No such attribute NoSuchAttributeException(in the API reference documentation)
17 Undefined attribute type InvalidAttributeIdentifierException(in the API reference documentation)
18 Inappropriate matching InvalidSearchFilterException(in the API reference documentation)
19 Constraint violation InvalidAttributeValueException(in the API reference documentation)
20 Attribute Or Value Exists AttributeInUseException(in the API reference documentation)
21 Invalid Attribute Syntax InvalidAttributeValueException(in the API reference documentation)
32 No such object NameNotFoundException(in the API reference documentation)
33 Alias problem NamingException(in the API reference documentation)
34 Invalid DN syntax InvalidNameException(in the API reference documentation)
35 Is leaf Used by LDAP provider; usually doesn't generate 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 detect 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