简体   繁体   中英

java.lang.NoClassDefFoundError: javax/security/auth/kerberos/KeyTab

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM