Hello,
We are trying to connect ODI studio to Hive. Hive server uses Kerberos authentication. We are using standard(Apache)jdbc driver instead of weblogic driver.
- ODI studio 12.2.1.2.6
- Kerberized HDP 2.6.3.0
- Windows 7
- hive-jdbc-2.1.0.2.6.3.0-235-standalone.jar(that is available under /usr/hdp/2.6.3.0-235/hive2/jdbc)


The C:\Oracle\Middleware\Oracle_Home\oracle_common\modules\datadirect\JDBCDriverLogin.conf
- JDBC_DRIVER_01{
- com.sun.security.auth.module.Krb5LoginModule required
- debug=true
- useTicketCache=true
- ticketCache = "C:\Users\ojoqcu\krb5cc_ojoqcu"
- principal="ojoqcu@GLOBAL.SCD.COM"
- default_realm = GLOBAL.SCD.COM
- java.security.krb5.conf=C:\Oracle\Middleware\Oracle_Home\oracle_common\modules\datadirect\kerb5.conf
- username=ojoqcu
- doNotPrompt=true;
- };
C:\Oracle\Middleware\Oracle_Home\oracle_common\modules\datadirect\kerb5.conf
-
[libdefaults]
-
renew_lifetime = 7d
-
forwardable = true
-
default_realm = GLOBAL.SCD.COM
-
ticket_lifetime = 10h
-
dns_lookup_realm = false
-
dns_lookup_kdc = true
-
default_ccache_name = C:\Users\ojoqcu\krb5cc_ojoqcu
-
allow_weak_crypto = yes
-
[logging]
-
default = FILE:/var/log/krb5kdc.log
-
admin_server = FILE:/var/log/kadmind.log
-
kdc = FILE:/var/log/krb5kdc.log
-
[realms]
-
GLOBAL.SCD.COM = {
-
default\_domain = sss.se.com
-
}
-
SE = {
-
default\_domain = sss.se.com
-
}
The complete error message is:
java.sql.SQLException: Could not open client transport for any of the Server URI's in ZooKeeper: Could not establish connection to jdbc:hive2://l4284t.sss.se.xxx.com:10501/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2-hive2: org.apache.hive.org.apache.http.client.ClientProtocolException
at oracle.odi.jdbc.datasource.LoginTimeoutDatasourceAdapter.doGetConnection(LoginTimeoutDatasourceAdapter.java:144)
at oracle.odi.jdbc.datasource.LoginTimeoutDatasourceAdapter.getConnection(LoginTimeoutDatasourceAdapter.java:73)
at com.sunopsis.sql.SnpsConnection.testConnection(SnpsConnection.java:1258)
at com.sunopsis.graphical.dialog.SnpsDialogTestConnet.getLocalConnect(SnpsDialogTestConnet.java:204)
at com.sunopsis.graphical.dialog.SnpsDialogTestConnet.access$500(SnpsDialogTestConnet.java:62)
at com.sunopsis.graphical.dialog.SnpsDialogTestConnet$6.doInBackground(SnpsDialogTestConnet.java:402)
at com.sunopsis.graphical.dialog.SnpsDialogTestConnet$6.doInBackground(SnpsDialogTestConnet.java:398)
at oracle.odi.ui.framework.AbsUIRunnableTask.run(AbsUIRunnableTask.java:258)
at oracle.ide.dialogs.ProgressBar.run(ProgressBar.java:961)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.sql.SQLException: Could not open client transport for any of the Server URI's in ZooKeeper: Could not establish connection to jdbc:hive2://l4284t.sss.se.xxx.com:10501/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2-hive2: org.apache.hive.org.apache.http.client.ClientProtocolException
at oracle.odi.jdbc.datasource.LoginTimeoutDatasourceAdapter.doGetConnection(LoginTimeoutDatasourceAdapter.java:144)
at oracle.odi.jdbc.datasource.LoginTimeoutDatasourceAdapter.getConnection(LoginTimeoutDatasourceAdapter.java:73)
at oracle.odi.core.datasource.dwgobject.support.OnConnectOnDisconnectDataSourceAdapter.getConnection(OnConnectOnDisconnectDataSourceAdapter.java:87)
at oracle.odi.jdbc.datasource.LoginTimeoutDatasourceAdapter$ConnectionProcessor.run(LoginTimeoutDatasourceAdapter.java:228)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
... 1 more
Caused by: java.sql.SQLException: Could not open client transport for any of the Server URI's in ZooKeeper: Could not establish connection to jdbc:hive2://l4284t.sss.se.xxx.com:10501/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2-hive2: org.apache.hive.org.apache.http.client.ClientProtocolException
at org.apache.hive.jdbc.HiveConnection.<init>(HiveConnection.java:211)
at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:107)
at oracle.odi.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriver(DriverManagerDataSource.java:412)
at oracle.odi.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriver(DriverManagerDataSource.java:385)
at oracle.odi.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriver(DriverManagerDataSource.java:352)
at oracle.odi.jdbc.datasource.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:331)
... 6 more
Caused by: java.sql.SQLException: Could not establish connection to jdbc:hive2://l4284t.sss.se.xxx.com:10501/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2-hive2: org.apache.hive.org.apache.http.client.ClientProtocolException
at org.apache.hive.jdbc.HiveConnection.openSession(HiveConnection.java:589)
at org.apache.hive.jdbc.HiveConnection.<init>(HiveConnection.java:188)
... 11 more
Caused by: org.apache.hive.org.apache.thrift.transport.TTransportException: org.apache.hive.org.apache.http.client.ClientProtocolException
at org.apache.hive.org.apache.thrift.transport.THttpClient.flushUsingHttpClient(THttpClient.java:297)
at org.apache.hive.org.apache.thrift.transport.THttpClient.flush(THttpClient.java:313)
at org.apache.hive.org.apache.thrift.TServiceClient.sendBase(TServiceClient.java:73)
at org.apache.hive.org.apache.thrift.TServiceClient.sendBase(TServiceClient.java:62)
at org.apache.hive.service.rpc.thrift.TCLIService$Client.send_OpenSession(TCLIService.java:162)
at org.apache.hive.service.rpc.thrift.TCLIService$Client.OpenSession(TCLIService.java:154)
at org.apache.hive.jdbc.HiveConnection.openSession(HiveConnection.java:578)
... 12 more
Caused by: org.apache.hive.org.apache.http.client.ClientProtocolException
at org.apache.hive.org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:186)
at org.apache.hive.org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:117)
at org.apache.hive.org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55)
at org.apache.hive.org.apache.thrift.transport.THttpClient.flushUsingHttpClient(THttpClient.java:251)
... 18 more
Caused by: org.apache.hive.org.apache.http.HttpException
at org.apache.hive.jdbc.HttpRequestInterceptorBase.process(HttpRequestInterceptorBase.java:86)
at org.apache.hive.org.apache.http.protocol.ImmutableHttpProcessor.process(ImmutableHttpProcessor.java:132)
at org.apache.hive.org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:182)
at org.apache.hive.org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
at org.apache.hive.org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.hive.org.apache.http.impl.execchain.ServiceUnavailableRetryExec.execute(ServiceUnavailableRetryExec.java:84)
at org.apache.hive.org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
... 21 more
Caused by: org.apache.hive.org.apache.http.HttpException
at org.apache.hive.jdbc.HttpKerberosRequestInterceptor.addHttpAuthHeader(HttpKerberosRequestInterceptor.java:68)
at org.apache.hive.jdbc.HttpRequestInterceptorBase.process(HttpRequestInterceptorBase.java:74)
... 27 more
Caused by: java.lang.reflect.UndeclaredThrowableException
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1884)
at org.apache.hive.service.auth.HttpAuthUtils.getKerberosServiceTicket(HttpAuthUtils.java:83)
at org.apache.hive.jdbc.HttpKerberosRequestInterceptor.addHttpAuthHeader(HttpKerberosRequestInterceptor.java:62)
... 28 more
Caused by: GSSException: No valid credentials provided (Mechanism level: Attempt to obtain new INITIATE credentials failed! (null))
at sun.security.jgss.krb5.Krb5InitCredential.getTgt(Krb5InitCredential.java:343)
at sun.security.jgss.krb5.Krb5InitCredential.getInstance(Krb5InitCredential.java:145)
at sun.security.jgss.krb5.Krb5MechFactory.getCredentialElement(Krb5MechFactory.java:122)
at sun.security.jgss.krb5.Krb5MechFactory.getMechanismContext(Krb5MechFactory.java:187)
at sun.security.jgss.GSSManagerImpl.getMechanismContext(GSSManagerImpl.java:224)
at sun.security.jgss.GSSContextImpl.initSecContext(GSSContextImpl.java:212)
at sun.security.jgss.GSSContextImpl.initSecContext(GSSContextImpl.java:179)
at org.apache.hive.service.auth.HttpAuthUtils$HttpKerberosClientAction.run(HttpAuthUtils.java:183)
at org.apache.hive.service.auth.HttpAuthUtils$HttpKerberosClientAction.run(HttpAuthUtils.java:151)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1866)
... 30 more
Caused by: javax.security.auth.login.LoginException: The handle is invalid
at com.sun.security.auth.module.Krb5LoginModule.promptForName(Krb5LoginModule.java:865)
at com.sun.security.auth.module.Krb5LoginModule.attemptAuthentication(Krb5LoginModule.java:704)
at com.sun.security.auth.module.Krb5LoginModule.login(Krb5LoginModule.java:617)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at javax.security.auth.login.LoginContext.invoke(LoginContext.java:755)
at javax.security.auth.login.LoginContext.access$000(LoginContext.java:195)
at javax.security.auth.login.LoginContext$4.run(LoginContext.java:682)
at javax.security.auth.login.LoginContext$4.run(LoginContext.java:680)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)
at javax.security.auth.login.LoginContext.login(LoginContext.java:587)
at sun.security.jgss.GSSUtil.login(GSSUtil.java:258)
at sun.security.jgss.krb5.Krb5Util.getTicket(Krb5Util.java:158)
at sun.security.jgss.krb5.Krb5InitCredential$1.run(Krb5InitCredential.java:335)
at sun.security.jgss.krb5.Krb5InitCredential$1.run(Krb5InitCredential.java:331)
at java.security.AccessController.doPrivileged(Native Method)
at sun.security.jgss.krb5.Krb5InitCredential.getTgt(Krb5InitCredential.java:330)
... 41 more