在windows下运行mapreduce项目,作业提交出现 Can not create a Path from an empty string异常教程
在windows下运行MapReduce项目时出现如下问题
Exception in thread “main” java.lang.IllegalArgumentException: Can not create a Path from an empty string
at org.apache.hadoop.fs.Path.checkPathArg(Path.java:127)
at org.apache.hadoop.fs.Path.(Path.java:135)
at org.apache.hadoop.fs.Path.(Path.java:94)
at org.apache.hadoop.mapred.LocalJobRunner$Job.(LocalJobRunner.java:156)
at org.apache.hadoop.mapred.LocalJobRunner.submitJob(LocalJobRunner.java:731)
at org.apache.hadoop.mapreduce.JobSubmitter.submitJobInternal(JobSubmitter.java:241)
at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1297)
at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1294)
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:1656)
at org.apache.hadoop.mapreduce.Job.submit(Job.java:1294)
at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:1314)
at forKPI.Browser.ForReducer.main(ForReducer.java:43)
最后发现可能是windows的用户名是中文或者使用微软的账号联网登录了。使用本地账户登录并且将用户名修改为英文即可。
源码中这一行获取不到用户名,导致这一行出错
然后在创建path的时候过不了chesk这一关,导致报错