Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

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

user1396641Nov 5 2015 — edited Nov 5 2015

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.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 3 2015
Added on Nov 5 2015
0 comments
11,445 views