Forum Stats

  • 3,770,276 Users
  • 2,253,087 Discussions
  • 7,875,382 Comments

Discussions

Kerberos works fine in the beginning but later gives "KrbException: Cannot locate default realm" err

user1396641
user1396641 Member Posts: 1
edited Nov 5, 2015 8:36PM in Kerberos & Java GSS (JGSS)

Hi,

So we have this application that runs on jboss and java 7u80.  It logs into kerberos to connect to hdfs name node.

The code is like is this:

System.setProperty("java.security.krb5.realm", "KERBEROS.COM");
System.setProperty("java.security.krb5.kdc", "10.3.0.190");
conf.set("hadoop.security.authentication", "Kerberos");

There is no krb5.conf file on the jboss server.

This works fine.  But if we don't make a call for a while, day or so, we get this error:

Caused by: java.lang.reflect.InvocationTargetException

  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_80]

  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_80]

  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_80]

  at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_80]

  at org.apache.hadoop.security.authentication.util.KerberosUtil.getDefaultRealm(KerberosUtil.java:84) [hadoop-auth-2.7.1.jar:]

  at org.apache.hadoop.security.HadoopKerberosName.setConfiguration(HadoopKerberosName.java:63) [hadoop-common-2.7.1.jar:]

  ... 47 more

Caused by: KrbException: Cannot locate default realm

  at sun.security.krb5.Config.getDefaultRealm(Config.java:1183) [rt.jar:1.7.0_80]

  ... 53 more

Caused by: KrbException: Generic error (description in e-text) (60) - Unable to locate Kerberos realm

  at sun.security.krb5.Config.getRealmFromDNS(Config.java:1279) [rt.jar:1.7.0_80]

  at sun.security.krb5.Config.getDefaultRealm(Config.java:1164) [rt.jar:1.7.0_80]

  ... 53 more

Any idea why it would stop working?

Also I have been looking for the source code for sun. package in the java sdk source.zip file and it is not there. I know that it used to be in jdk 6 but all of a sudden I can't find it in jdk 7 and later.  What happened? 

Thanks.

This discussion has been closed.