0
votes

I am new in hadoop. I am trying to run a job by toolrunner of hadoop from java code in netbeans environment. But still I can't find a solution to fix the issue.

Exception in thread "main" java.lang.NoClassDefFoundError: javax/security/auth/kerberos/KeyTab at org.apache.hadoop.security.UserGroupInformation.(UserGroupInformation.java:609) at org.apache.hadoop.security.UserGroupInformation.loginUserFromSubject(UserGroupInformation.java:799) at org.apache.hadoop.security.UserGroupInformation.getLoginUser(UserGroupInformation.java:760) at org.apache.hadoop.security.UserGroupInformation.getCurrentUser(UserGroupInformation.java:633) at org.apache.hadoop.fs.FileSystem$Cache$Key.(FileSystem.java:2812) at org.apache.hadoop.fs.FileSystem$Cache$Key.(FileSystem.java:2802) at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:2668) at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:371) at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:170) at org.enahang.mapreduce.utils.mrUtils.Test.run(Test.java:125) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70) at org.enahang.mapreduce.utils.mrUtils.Test.main(Test.java:62)

My platform is windows 7.


I’ve added many libraries. First of all I’ve added the Apacheds-kerberos-codec-2.0.0-M15.jar Then I added many other libraries similar Javaee-api-7.0.jar java-rt-jar-stubs-1.5.0.jar … But I don’t know from where the error arises.

This is the complete list of .jar files I added to include Keytab class in code: apacheds-i18n-2.0.0-M15.jar api-asn1-api-1.0.0-M20.jar api-util-1.0.0-M20.jar commons-cli-1.2.jar commons-codec-1.4.jar commons-collections-3.2.1.jar commons-configuration-1.6.jar jsp-api-2.1.jar hadoop-auth-2.7.0.jar

Thanks in advance

1
before getting this error my hadoop core was hadoop-core-1.2.1.jar. But because of an error of read/write permission in win 7, and a hint about using hadoop-0.20.2-core.jar, I removed the first jar and then I added the second jar - e nahang
I think, I resolved the problem by adding hadoop-conf-kerberos-6.0.0.jar. However, a new error is arised as such: " java.lang.IllegalArgumentException: Can't get Kerberos realm" - e nahang

1 Answers

0
votes

Ok, I think for this question the research is enough; The answer is that hadoop-conf-kerberos-6.0.0.jar contains some xml and properties files for configuration of hadoop with respect to kerberos. The problem of my program to find the class of KeyTab was the result of a bad configuration. [hadoop-conf-kerberos-6.0.0.jar][1]contains prepared configuration files similar core-site.xml, hdfs-site.xml, mapred-site.xml, etc. It complemented the Apacheds-kerberos-codec-2.0.0-M15.jar I had added to my program.