Exception in thread "main" java.lang.NoSuchFieldError: IBM_JAVA
at org.apache.hadoop.security.UserGroupInformation.getOSLoginModuleName(UserGroupInformation.java:303)
at org.apache.hadoop.security.UserGroupInformation.<clinit>(UserGroupInformation.java:348)
at org.apache.hadoop.mapreduce.task.JobContextImpl.<init>(JobContextImpl.java:72)
at org.apache.hadoop.mapreduce.Job.<init>(Job.java:133)
at org.apache.hadoop.mapreduce.Job.<init>(Job.java:123)
at org.apache.hadoop.mapreduce.Job.<init>(Job.java:128)
at driver.main(driver.java:64)
使用ubuntu 12.04 32位获取上述错误,我正在使用的java jdk是java-6-openjdk-i386
。
这是驱动程序类代码: -
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
import org.apache.hadoop.mapreduce.task.JobContextImpl;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hadoop.mapreduce.Reducer;
Job baseJob = new Job(conf,"baseJob");//for base itemsets
答案 0 :(得分:2)
我遇到了同样的例外 原因是您的java依赖性不完整,您丢失了jar包hadoop-auth-2.2.0.jar或其新版本。字段IBM_JAVA位于java类PlatformName.class中,该类位于hadoop-auth-2.2.0.jar中的org.apache.hadoop.util包中。