I was trying to connect to Knox gateway using Knox login() service. Service
was successfully deployed and running. But after sometime it started
throwing exception "Http://101 unauthorized"

I don't know what's the cause. Gateway.log file is not giving any logs
about 'access granted or not'.

I have reconfigured my LDAP server. I have reconfigured Knox. I have
restarted Tomcat. But still unable to resolve the issue.

Following is the code:

def login(username: String, password: String): String = {
    try {
      val gateway = "https://localhost:8443/gateway/cluster1";
      val hadoop = Hadoop.login(gateway, username, password)
   println(Hdfs.ls(hadoop).dir("/").now().toString)
        return "successfully logged in"
    } catch {
      case ex: Exception => {
        println(ex.getCause().toString())
        ex.getMessage()
      }
    }
  }

Reply via email to