Package netscape.ldap

Class LDAPException

java.lang.Object
java.lang.Throwable
java.lang.Exception
netscape.ldap.LDAPException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
LDAPInterruptedException, LDAPReferralException

public class LDAPException extends Exception implements Serializable
Indicates that an error has occurred. An LDAPException can result from physical problems (such as network errors) as well as problems with LDAP operations (for example, if the LDAP add operation fails because of duplicate entry).

Most errors that occur throw this type of exception. In order to determine the cause of the error, you can call the getLDAPResultCode() method to get the specific result code and compare this code against the result codes defined as fields in this class. (For example, if the result code matches the value of the field LDAPException.TIME_LIMIT_EXCEEDED, the time limit passed before the search operation could be completed.)

This exception includes methods for getting an error message that corresponds to the LDAP result code (for example, "Timelimit exceeded" for LDAPException.TIME_LIMIT_EXCEEDED). These error messages are specified in the following files:

netscape/ldap/errors/ErrorCodes_locale_string.props
where locale_string is the name of the locale that includes the language and country, but not the variant.

For example:

netscape/ldap/errors/ErrorCodes_en_US.props
The LDAP Java classes get this locale name by calling the java.util.Locale.toString method for the specified locale and ignoring the variant. If no locale is specified, the LDAP Java classes use the java.util.Locale.getDefault method to get the locale of the local host system.

In order to get error messages for different locales, you need to provide files containing the error messages for those locales. The files should be located in the netscape/ldap/errors directory and should use the naming convention specified above.

The following is a list of LDAP result codes:

 Result
  Code   Defined Value
 ======  =============
   0     SUCCESS
   1     OPERATION_ERROR
   2     PROTOCOL_ERROR
   3     TIME_LIMIT_EXCEEDED
   4     SIZE_LIMIT_EXCEEDED
   5     COMPARE_FALSE
   6     COMPARE_TRUE
   7     AUTH_METHOD_NOT_SUPPORTED
   8     STRONG_AUTH_REQUIRED
   9     LDAP_PARTIAL_RESULTS
  10     REFERRAL (LDAP v3)
  11     ADMIN_LIMIT_EXCEEDED (LDAP v3)
  12     UNAVAILABLE_CRITICAL_EXTENSION (LDAP v3)
  13     CONFIDENTIALITY_REQUIRED (LDAP v3)
  14     SASL_BIND_IN_PROGRESS (LDAP v3)
  16     NO_SUCH_ATTRIBUTE
  17     UNDEFINED_ATTRIBUTE_TYPE
  18     INAPPROPRIATE_MATCHING
  19     CONSTRAINT_VIOLATION
  20     ATTRIBUTE_OR_VALUE_EXISTS
  21     INVALID_ATTRIBUTE_SYNTAX
  32     NO_SUCH_OBJECT
  33     ALIAS_PROBLEM
  34     INVALID_DN_SYNTAX
  35     IS_LEAF
  36     ALIAS_DEREFERENCING_PROBLEM
  48     INAPPROPRIATE_AUTHENTICATION
  49     INVALID_CREDENTIALS
  50     INSUFFICIENT_ACCESS_RIGHTS
  51     BUSY
  52     UNAVAILABLE
  53     UNWILLING_TO_PERFORM
  54     LOOP_DETECT
  64     NAMING_VIOLATION
  65     OBJECT_CLASS_VIOLATION
  66     NOT_ALLOWED_ON_NONLEAF
  67     NOT_ALLOWED_ON_RDN
  68     ENTRY_ALREADY_EXISTS
  69     OBJECT_CLASS_MODS_PROHIBITED
  71     AFFECTS_MULTIPLE_DSAS (LDAP v3)
  80     OTHER
  81     SERVER_DOWN
  85     LDAP_TIMEOUT
  89     PARAM_ERROR
  91     CONNECT_ERROR
  92     LDAP_NOT_SUPPORTED
  93     CONTROL_NOT_FOUND
  94     NO_RESULTS_RETURNED
  95     MORE_RESULTS_TO_RETURN
  96     CLIENT_LOOP
  97     REFERRAL_LIMIT_EXCEEDED
 112     TLS_NOT_SUPPORTED (LDAP v3)
 

Version:
1.0
See Also: