Start a new topic

Kerberos issue with 14.0

I updated from 13.x to 14.0 and now I can no longer connect to my Kerberized Hive instances...

An error occurred while establishing the connection:

Long Message:

Can't get Kerberos realm

Details:

   Type: java.lang.IllegalArgumentException

Stack Trace:

java.lang.IllegalAccessException: class org.apache.hadoop.security.authentication.util.KerberosUtil cannot access class sun.security.krb5.Config (in module java.security.jgss) because module java.security.jgss does not export sun.security.krb5 to unnamed module @7a33f674

   at java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:392)

   at java.base/java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:674)

   at java.base/java.lang.reflect.Method.invoke(Method.java:560)

   at org.apache.hadoop.security.authentication.util.KerberosUtil.getDefaultRealm(KerberosUtil.java:81)

   at org.apache.hadoop.security.HadoopKerberosName.setConfiguration(HadoopKerberosName.java:63)

[wrapped] java.lang.IllegalArgumentException: Can't get Kerberos realm

   at org.apache.hadoop.security.HadoopKerberosName.setConfiguration(HadoopKerberosName.java:65)

   at org.apache.hadoop.security.UserGroupInformation.initialize(UserGroupInformation.java:275)

   at org.apache.hadoop.security.UserGroupInformation.setConfiguration(UserGroupInformation.java:311)

   at org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge.createClientWithConf(HadoopThriftAuthBridge.java:96)

   at org.apache.hive.service.auth.KerberosSaslHelper.getKerberosTransport(KerberosSaslHelper.java:54)

   at org.apache.hive.jdbc.HiveConnection.createBinaryTransport(HiveConnection.java:416)

   at org.apache.hive.jdbc.HiveConnection.openTransport(HiveConnection.java:201)

   at org.apache.hive.jdbc.HiveConnection.<init>(HiveConnection.java:168)

   at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:105)

   at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

   at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)

   at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

   at java.base/java.lang.reflect.Method.invoke(Method.java:568)

   at com.onseven.dbvis.jdbc.b.e.b(Z:525)

   at com.onseven.dbvis.jdbc.b.g$_b.call(Z:618)

   at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)

   at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)

   at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)

   at java.base/java.lang.Thread.run(Thread.java:833)


 

 

 


The problem is that the JDBC uses internally APIs in Java. 

To workaround this, try add the following in Tools->Tool Properties and in the General category under Specify Overridden Java Properties here text area:

--add-exports java.security.jgss/sun.security.krb5=ALL-UNNAMED


Regards Ulf



1 person likes this

This work around doesn't work for my case. 


Product: DbVisualizer Pro 23.1 (build: 3713)

OS: Windows 11

OS Version: 10.0

OS Arch: amd64

Java Version: 17.0.6

Java VM: OpenJDK 64-Bit Server VM

Java Vendor: Eclipse Adoptium

Java Home: c:\program files\dbvisualizer\jre

DbVis Home: C:\Program Files\DbVisualizer


Working in my case

@Ashish Doneriya what is "your case"?
Did you take some different step(s) than mentioned in this issue?

I was trying get Subject object login via kerberos credentials. Facing the same problem when updated from Java 8 to 17. So I add the export property during jar execution java --add-exports java.security.jgss/sun.security.krb5=ALL-UNNAMED -jar jarname.jar
Login or Signup to post a comment