title: ERROR org.apache.thrift.transport.TSaslTransport - SASL negotiation failure javax.security.sasl.SaslException: GSS initiate failed
body: <p>did try write hive client that working with Kerberos.</p>
  
  <p>IDEA did work in OS Windows 2012 R2,
  I did prepare folder with Hadoop files (did copy from there <a href="https://github.com/steveloughran/winutils" rel="nofollow noreferrer">winutils</a>) to local folder </p>
  
  <pre><code>c:\hadoop
  </code></pre>
  
  <p>After did set evironment</p>
  
  <pre><code>  set HOME_HADOOP=c:\hadoop
  </code></pre>
  
  <p>Then did write this code</p>
  
  <pre><code>public static void main (String args[]) {
      try {
          org.apache.hadoop.conf.Configuration conf = new     org.apache.hadoop.conf.Configuration();
          conf.set("hadoop.security.authentication", "Kerberos");
          UserGroupInformation.setConfiguration(conf);
          UserGroupInformation.loginUserFromKeytab("testuser@DOM.COM", "C:\\Servers\\Repository\\Templates\\HiveClient\\src\\main\\resources\\testuser.keytab");
          Class.forName("org.apache.hive.jdbc.HiveDriver");
          System.out.println("getting connection");
          Connection con = DriverManager.getConnection("jdbc:hive2://rnd-server02:10010/default;principal=testuser@DOM.COM");
          System.out.println("Connected");
          con.close();
      }
      catch (Exception e) {
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>Did try to excute and did return error</p>
  
  <pre><code>00:49:05.950 [main] ERROR org.apache.thrift.transport.TSaslTransport - SASL negotiation failure
  javax.security.sasl.SaslException: GSS initiate failed
      at com.sun.security.sasl.gsskerb.GssKrb5Client.evaluateChallenge(GssKrb5Client.java:211) ~[?:1.8.0_121]
      at org.apache.thrift.transport.TSaslClientTransport.handleSaslStartMessage(TSaslClientTransport.java:94) ~[libthrift-0.9.3.jar:0.9.3]
      at org.apache.thrift.transport.TSaslTransport.open(TSaslTransport.java:271) [libthrift-0.9.3.jar:0.9.3]
      at 
  </code></pre>
  
  <p>How solve this problem?</p>