org.apache.hadoop.io.nativeio.NativeIO$Windows.createDirectoryWithMode0(Ljava/lang/String;I)V
win7+eclipse+hadoop2.7.0报错!Exceptioninthread"main"java.lang.UnsatisfiedLinkError:org....
win7+eclipse+hadoop2.7.0报错!
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.mapreduce.Job.waitForCompletion(Job.java:1308)
at com.wf.WordCount.main(WordCount.java:40)
hadoop.dll已经放到system32和SysWow64中winutils.exe也已经放到hadoop/bin目录下了。
求大神帮忙啊,跪求解答!
原因:是你的hadoop.dll 文件和你当前的hadoop版本不匹配。
过程:我的版本是hadoop 2.7.1,前期使用的是从网上下载的用于hadoop-2.6-x64-bin。最后导致的结果是:start-dfs.cmd可以执行,也就是hdfs系统可以启动,但是在启动start-yarn.cmd的时候,就报错和你一样。可能是createDirectoryWithMode0方法在hadoop.dll中没有做本地实现。
解决:重新编译适用于你的hadoop版本的hadoop.dll文件。我前期编译不成功,可能是项目依赖的windows sdk 7不正确,升级到windows10后,直接用visual studio 10 旗舰版编译f:\hadoop_2.7\src\hadoop-common-project\hadoop-common\src\main\native\native.sln 就可以搞定了。
如果需要,我这里有2.7.1的hadoop.dll.