UnsatisfiedLinkError beim ausführen von Hadoop-MapReduce Java-Programm

Ich versuche zu laufen diese Karte Reduzieren Programm mit Hadoop auf Windows 8.1. Nach viel Mühe, ich habe es ziemlich in der Nähe arbeiten. Ich habe Java 1.8.0_45 und Hadoop-2.7.0. Ich habe auch die winutils.exe und hadoop.dll die verursacht Probleme für viele Menschen.

Hier ist der code:

public class OSProject {

public static class Map extends MapReduceBase implements
        Mapper<LongWritable, Text, Text, IntWritable> {

    @Override
    public void map(LongWritable key, Text value, OutputCollector<Text, IntWritable> output, Reporter reporter)
            throws IOException {

        String line = value.toString();
        StringTokenizer tokenizer = new StringTokenizer(line);

        while (tokenizer.hasMoreTokens()) {
            value.set(tokenizer.nextToken());
            output.collect(value, new IntWritable(1));
        }

    }
}

public static class Reduce extends MapReduceBase implements
        Reducer<Text, IntWritable, Text, IntWritable> {

    @Override
    public void reduce(Text key, Iterator<IntWritable> values,
            OutputCollector<Text, IntWritable> output, Reporter reporter)
            throws IOException {
        int sum = 0;
        while (values.hasNext()) {
            sum += values.next().get();
        }

        output.collect(key, new IntWritable(sum));
    }
}

public static void main(String[] args) throws Exception {

    BasicConfigurator.configure();
    JobConf conf = new JobConf(OSProject.class);
    conf.setJobName("wordcount");

    conf.setOutputKeyClass(Text.class);
    conf.setOutputValueClass(IntWritable.class);

    conf.setMapperClass(Map.class);
    conf.setReducerClass(Reduce.class);

    conf.setInputFormat(TextInputFormat.class);
    conf.setOutputFormat(TextOutputFormat.class);

    FileInputFormat.setInputPaths(conf, new Path("c:/hwork/input"));
    FileOutputFormat.setOutputPath(conf, new Path("c:/hwork/output"));

    //FileInputFormat.setInputPaths(conf, new Path(args[0]));
    //FileOutputFormat.setOutputPath(conf, new Path(args[1]));

    JobClient.runJob(conf);

}
}

Das problem ist, dass das Programm wirft diese Fehlermeldung wenn ich es ausführen:

Exception in thread "main" java.lang.UnsatisfiedLinkError: org.apache.hadoop.io.nativeio.NativeIO$Windows.createDirectoryWithMode0(Ljava/lang/String;I)V
at org.apache.hadoop.io.nativeio.NativeIO$Windows.createDirectoryWithMode0(Native Method)
at org.apache.hadoop.io.nativeio.NativeIO$Windows.createDirectoryWithMode(NativeIO.java:524)
at org.apache.hadoop.fs.RawLocalFileSystem.mkOneDirWithMode(RawLocalFileSystem.java:473)
at org.apache.hadoop.fs.RawLocalFileSystem.mkdirsWithOptionalPermission(RawLocalFileSystem.java:526)
at org.apache.hadoop.fs.RawLocalFileSystem.mkdirs(RawLocalFileSystem.java:504)
at org.apache.hadoop.fs.FilterFileSystem.mkdirs(FilterFileSystem.java:305)
at org.apache.hadoop.mapreduce.JobSubmissionFiles.getStagingDir(JobSubmissionFiles.java:133)
at org.apache.hadoop.mapreduce.JobSubmitter.submitJobInternal(JobSubmitter.java:147)
at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1290)
at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1287)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)
at org.apache.hadoop.mapreduce.Job.submit(Job.java:1287)
at org.apache.hadoop.mapred.JobClient$1.run(JobClient.java:562)
at org.apache.hadoop.mapred.JobClient$1.run(JobClient.java:557)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)
at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:557)
at org.apache.hadoop.mapred.JobClient.submitJob(JobClient.java:548)
at org.apache.hadoop.mapred.JobClient.runJob(JobClient.java:833)
at osproject.OSProject.main(OSProject.java:86)

Die Linie, dass es Fehler auf:

JobClient.runJob(conf);

Wie es aussieht ist, dass Sie nicht erstellen Sie die Ausgabe-Datei aus irgendeinem Grund. Jede Antwort auf die Frage, warum dies geschieht und wie es zu beheben würde sehr geschätzt werden.

Ich denke, Sie bauen diese app mit JDK 1.8. Sie sollten prüfen, ob Sie die app ausführen mit der richtigen JRE, vielleicht Ihr Standard-JRE von Java 6
Das scheint nicht das Problem sein. Sie sind beide Java 8.
Sind Ihre Pfade, ok? Bitte überprüfen "c:/hwork/input" oder einen relativen Pfad für jetzt
Ich bin nicht zu sehen, ein Problem mit der Eingabe-Pfad. Mit den Ausgabe-Pfad, wenn der Ordner vorhanden ist, gibt es eine Fehlermeldung, die besagt, dass "die Ausgabe-Verzeichnis die Datei: /hwork/Ausgang ist bereits vorhanden". Also ich nehme an, eine der Methoden, die in den Bibliotheken soll, erstellen Sie das Verzeichnis selbst. Es gibt die Fehler angegeben, mit der Frage, ob das Verzeichnis "C:/hwork/output" gibt es nicht. Ich habe versucht, die Einstellung auf eine Anzahl von unterschiedlichen Pfaden, aber es hat keine Wirkung.
möglich, Duplikat der Hadoop auf Windows. GARN lässt sich nicht starten, mit java.lang.UnsatisfiedLinkError

InformationsquelleAutor Moatimus | 2015-05-10

Schreibe einen Kommentar