Lösung für Fehler, die durch lokale Ausführung des MapReduce-Programms in Windows gemeldet wurden

Lösung für Fehler, die durch lokale Ausführung des MapReduce-Programms in Windows gemeldet wurden

1. Problembeschreibung

 Auf dem Windows-System wird das MapReduce-Programm lokal ausgeführt und ein Fehler gemeldet:

Exception in thread "main" java.lang.UnsatisfiedLinkError: org.apache.hadoop.io.nativeio.NativeIO$Windows.access0(Ljava/lang/String;I)Z
	at org.apache.hadoop.io.nativeio.NativeIO$Windows.access0(Native Method)
	at org.apache.hadoop.io.nativeio.NativeIO$Windows.access(NativeIO.java:606)

2. Lösung

 Kopieren Sie den Quellcode org.apache.hadoop.io.nativeio.NativeIOin das Projekt, achten Sie auf den Paketnamen und ändern Sie die public static boolean access(String path, AccessRight desiredAccess) throws IOExceptionMethode wie folgt:

public static boolean access(String path, AccessRight desiredAccess)
    throws IOException {
    
    
    String os = System.getProperty("os.name");
    return os.contains("Windows") || access0(path, desiredAccess.accessRight());
}

Ich denke du magst

Origin blog.csdn.net/adsl624153/article/details/100069911
Empfohlen
Rangfolge