错误如:
java.lang.NoSuchMethodException: mapreduce.utilproject.CarMapReduceOne$CarMapper1.<init>()
我的错误显示:
15/09/17 12:17:18 INFO mapreduce.Job: Job job_1435558921826_7225 running in uber mode : false
15/09/17 12:17:18 INFO mapreduce.Job: map 0% reduce 0%
15/09/17 12:17:24 INFO mapreduce.Job: Task Id : attempt_1435558921826_7225_m_000000_0, Status : FAILED
Error: java.lang.RuntimeException: java.lang.NoSuchMethodException: mapreduce.utilproject.CarMapReduceOne$CarMapper1.<init>()
at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:131)
at org.apache.hadoop.mapreduce.lib.input.DelegatingMapper.setup(DelegatingMapper.java:46)
at org.apache.hadoop.mapreduce.lib.input.DelegatingMapper.run(DelegatingMapper.java:54)
at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:784)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341)
at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:163)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1628)
at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
Caused by: java.lang.NoSuchMethodException: mapreduce.utilproject.CarMapReduceOne$CarMapper1.<init>()
at java.lang.Class.getConstructor0(Class.java:2892)
at java.lang.Class.getDeclaredConstructor(Class.java:2058)
at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:125)
... 9 more
把Mapper和Reducer 改为 静态的,class前面添加static。。
犯这个错误应该是写代码疏忽导致的。。