apache/hadoop · error · NullPointerException

The LDAP URI can not be null

Error message

The LDAP URI can not be null

What it means

Thrown as a NullPointerException from LdapAuthenticationHandler.init when the LDAP provider URL property is missing from the config. The handler has no LDAP server to bind against, so initialization fails.

Solutions

  1. Configure the LDAP provider URL in the handler init parameters.

Example fix

Set init-param ldap.providerurl=ldap://ldap.example.com:389.
Defensive patterns

Strategy: validation

When it happens

Trigger: Raised at runtime when the documented precondition or configuration requirement for this operation is violated.

Common situations: Misconfigured or missing property, invalid user input, or calling the API before its prerequisites are met.


AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22). Data as JSON: /api/errors/7bb4eaa55fce088f. Report an issue: GitHub.

Appendix: source

Thrown at hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/server/LdapAuthenticationHandler.java:147

      Boolean disableHostNameVerification) {
    this.disableHostNameVerification = disableHostNameVerification;
  }

  @Override
  public String getType() {
    return TYPE;
  }

  @Override
  public void init(Properties config) throws ServletException {
    this.baseDN = config.getProperty(BASE_DN);
    this.providerUrl = config.getProperty(PROVIDER_URL);
    this.ldapDomain = config.getProperty(LDAP_BIND_DOMAIN);
    this.enableStartTls =
        Boolean.valueOf(config.getProperty(ENABLE_START_TLS, "false"));

    if (this.providerUrl == null) {
      throw new NullPointerException("The LDAP URI can not be null");
    }
    if (!((this.baseDN == null)
        ^ (this.ldapDomain == null))) {
      throw new IllegalArgumentException(
          "Either LDAP base DN or LDAP domain value needs to be specified");
    }
    if (this.enableStartTls) {
      String tmp = this.providerUrl.toLowerCase();
      if (tmp.startsWith("ldaps")) {
        throw new IllegalArgumentException(
            "Can not use ldaps and StartTLS option at the same time");
      }
    }
  }

  @Override
  public void destroy() {
  }

View on GitHub (pinned to 2add963021)