Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

hive connection using SSL ( without Kerberos ). Getting Connection error: java.sql.SQLException: Could not open client transport with JDBC Uri

Highlighted

hive connection using SSL ( without Kerberos ). Getting Connection error: java.sql.SQLException: Could not open client transport with JDBC Uri

New Contributor

I am trying to make connection between hive-server2 and my local window machine with python.I have Connection string and a keystore file. I am using Jaydebeapi python module to solve this issue. The various .jar file I am using:
1) HiveJDBC4.jar
2) hive_metastore.jar
3) hive-service-0.13.1.jar
4) libfb303-0.9.0.jar
5) libthrift-0.9.0.jar
6) log4j-1.2.14.jar
7) ql.jar
8) slf4j-api-1.5.8.jar
9) slf4j-log4j12-1.5.8.jar
10) TCLIServiceClient.jar
11) httpclient-4.3.3.jar
12) httpcore-4.3.jar
13) guava-16.0.1.jar
14) hadoop-common-2.2.0.jar
15) hive-common-0.10.0.jar

My connection string is:

jdbc:hive2://example@domain.com:port/;  ssl=true;  sslTrustStore=FileKey.jks;  trustStorePassword=password;  transportMode=http;  httpPath=gateway/default/hive  


I am trying to make connection between hive-server2 and my local window machine with python.I have Connection string and a keystore file. I am using Jaydebeapi python module to solve this issue. The various .jar file I am using:
1) HiveJDBC4.jar
2) hive_metastore.jar
3) hive-service-0.13.1.jar
4) libfb303-0.9.0.jar
5) libthrift-0.9.0.jar
6) log4j-1.2.14.jar
7) ql.jar
8) slf4j-api-1.5.8.jar
9) slf4j-log4j12-1.5.8.jar
10) TCLIServiceClient.jar
11) httpclient-4.3.3.jar
12) httpcore-4.3.jar
13) guava-16.0.1.jar
14) hadoop-common-2.2.0.jar
15) hive-common-0.10.0.jar

My connection string is:

jdbc:hive2://example@domain.com:port/;  ssl=true;  sslTrustStore=FileKey.jks;  trustStorePassword=password;  transportMode=http;  httpPath=gateway/default/hive  

I have tried other modules but for the given problem and inputs, Jaydebeapi approach I found to be more valid here. I have written python code:

import jaydebeapi
Jars = ['C:/Cloudera_HiveJDBC/HiveJDBC4.jar',   
        'C:/Cloudera_HiveJDBC/hive_metastore.jar',   
        'C:/Cloudera_HiveJDBC/hive-service-0.13.1.jar',   
        'C:/Cloudera_HiveJDBC/libfb303-0.9.0.jar',   
        'C:/Cloudera_HiveJDBC/libthrift-0.9.0.jar',   
        'C:/Cloudera_HiveJDBC/log4j-1.2.14.jar',   
        'C:/Cloudera_HiveJDBC/ql.jar',  
        'C:/Cloudera_HiveJDBC/slf4j-api-1.5.8.jar',  
        'C:/Cloudera_HiveJDBC/slf4j-log4j12-1.5.8.jar',  
        'C:/Cloudera_HiveJDBC/TCLIServiceClient.jar',   
        'C:/Cloudera_HiveJDBC/httpclient-4.3.3.jar',   
        'C:/Cloudera_HiveJDBC/httpcore-4.3.jar',  
        'C:/Cloudera_HiveJDBC/guava-16.0.1.jar',   
        'C:/Cloudera_HiveJDBC/hadoop-common-2.2.0.jar',   
        'C:/Cloudera_HiveJDBC/hive-common-0.10.0.jar']
conn_hive = jaydebeapi.connect('org.apache.hive.jdbc.HiveDriver','jdbc:hive2://example@domain.com:port/',                              {'ssl':"true",                     
          'sslTrustStore':"Filekey.jks",           
          'trustStorePassword':"password",                          
          'transportMode':"http",                           
          'httpPath':"gateway/default/hive"},jars= Jars)
cursor = conn_hive.cursor()

But I am getting an error:

java.sql.SQLExceptionPyRaisable: java.sql.SQLException: Could not open client transport with JDBC Uri: jdbc:hive2://example@domain.com:port/: null

Is there any problem with the code, in approach or lack of Jar Files I have added. Is there any other alternatives that I can use for giving best results.