{"record":{"id":"7bb4eaa55fce088f","repo":"apache/hadoop","slug":"the-ldap-uri-can-not-be-null","errorCode":null,"errorMessage":"The LDAP URI can not be null","messagePattern":"The LDAP URI can not be null","errorType":"exception","errorClass":"NullPointerException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/server/LdapAuthenticationHandler.java","lineNumber":147,"sourceCode":"      Boolean disableHostNameVerification) {\n    this.disableHostNameVerification = disableHostNameVerification;\n  }\n\n  @Override\n  public String getType() {\n    return TYPE;\n  }\n\n  @Override\n  public void init(Properties config) throws ServletException {\n    this.baseDN = config.getProperty(BASE_DN);\n    this.providerUrl = config.getProperty(PROVIDER_URL);\n    this.ldapDomain = config.getProperty(LDAP_BIND_DOMAIN);\n    this.enableStartTls =\n        Boolean.valueOf(config.getProperty(ENABLE_START_TLS, \"false\"));\n\n    if (this.providerUrl == null) {\n      throw new NullPointerException(\"The LDAP URI can not be null\");\n    }\n    if (!((this.baseDN == null)\n        ^ (this.ldapDomain == null))) {\n      throw new IllegalArgumentException(\n          \"Either LDAP base DN or LDAP domain value needs to be specified\");\n    }\n    if (this.enableStartTls) {\n      String tmp = this.providerUrl.toLowerCase();\n      if (tmp.startsWith(\"ldaps\")) {\n        throw new IllegalArgumentException(\n            \"Can not use ldaps and StartTLS option at the same time\");\n      }\n    }\n  }\n\n  @Override\n  public void destroy() {\n  }","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/server/LdapAuthenticationHandler.java#L129-L165","documentation":"Error \"The LDAP URI can not be null\" thrown in apache/hadoop.","triggerScenarios":"Raised at runtime when the documented precondition or configuration requirement for this operation is violated.","commonSituations":"Misconfigured or missing property, invalid user input, or calling the API before its prerequisites are met.","solutions":["Configure the LDAP provider URL in the handler init parameters."],"exampleFix":"Set init-param ldap.providerurl=ldap://ldap.example.com:389.","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}