AnsweredAssumed Answered

Cannot connect to secured HiveServer2 from remote client

Question asked by bencetamas on Jun 10, 2015
Latest reply on Jul 22, 2017 by arjunkr

I've setup a secure cluster with HiveServer2 (with the newest packages), using Mapr-SASL. It seems everything works fine, I can authenticate with maprlogin utility from remote clients and submit jobs, etc.
But I cannot connect to HiveServer2 using with my java application. I get error, at the line

    Connection con = DriverManager.getConnection("jdbc:hive2://;auth=maprsasl;sasl.qop=auth-conf","mapr","mapr");

I get the following error:

    Exception in thread "main" java.lang.NullPointerException
     at java.lang.Class.forName0(Native Method)
     at java.lang.Class.forName(
     at org.apache.hadoop.conf.Configuration.getClassByNameOrNull(
     at org.apache.hadoop.conf.Configuration.getClassByName(
     at org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge25Sasl.createClientWithConf(
     at org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge25Sasl.createClientWithConf(
     at org.apache.hive.service.auth.MapRSecSaslHelper.getTransport(
     at org.apache.hive.jdbc.HiveConnection.createBinaryTransport(
     at org.apache.hive.jdbc.HiveConnection.openTransport(
     at org.apache.hive.jdbc.HiveConnection.<init>(
     at org.apache.hive.jdbc.HiveDriver.connect(
     at java.sql.DriverManager.getConnection(
     at java.sql.DriverManager.getConnection(
     at test.Program.main(

After some debugging it seems that the SecurityUtil.getCustomRpcAuthMethod method uses a configuration property "", which is not set. But I found nothing about this property, how can I set, and what value it needs.

I also set the JVM properties described in [][1]. First I've put these jars from the hadoop cluster to the classpath:


I also tried to put the hive-shims-*jar-s to the classpath, and other jars too, with no success.
I also tried jdbc:hive2://;auth=maprsasl;sasl.qop=auth-conf and
jdbc:hive2://;auth=maprsasl as connection strings.

Has anyone some idea, what could be the problem?

Thank you!
Bence Tamas