• java.lang.RuntimeException: java.lang.NoSuchMethodException:


    [java] 15/12/19 14:09:46 INFO mapred.JobClient: Task Id : attempt_201512182036_0017_m_000000_0, Status : FAILED
    [java] java.lang.RuntimeException: java.lang.NoSuchMethodException: org.lukey.hadoop.tianyi.TianYiBigData$MyMapper.<init>()
    [java] at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:115)
    [java] at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:719)
    [java] at org.apache.hadoop.mapred.MapTask.run(MapTask.java:370)
    [java] at org.apache.hadoop.mapred.Child$4.run(Child.java:255)
    [java] at java.security.AccessController.doPrivileged(Native Method)
    [java] at javax.security.auth.Subject.doAs(Subject.java:422)
    [java] at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1121)
    [java] at org.apache.hadoop.mapred.Child.main(Child.java:249)
    [java] Caused by: java.lang.NoSuchMethodException: org.lukey.hadoop.tianyi.TianYiBigData$MyMapper.<init>()
    [java] at java.lang.Class.getConstructor0(Class.java:3082)
    [java] at java.lang.Class.getDeclaredConstructor(Class.java:2178)
    [java] at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:109)
    [java] ... 7 more

    需要在MyMapper前面加static。

    If the class is an inner class, make sure it's declared static (i.e. doesn't need an instance of the enclosing class). Otherwise, Hadoop cannot instantiate your inner class and will give this same error - that a zero-arg constructor is needed.

    http://stackoverflow.com/questions/11446635/no-such-method-exception-hadoop-init

  • 相关阅读:
    网络嗅探器
    struct udphdr
    struct tcphdr
    struct iphdr
    socket函数
    SQL SERVER-解析Extendevent文件数据
    SQL SERVER-日期按时区转换
    SQL SERVER-CROSS APPLY
    WinServer-文件共享端口
    SQL SERVER-修改实例的排序规则
  • 原文地址:https://www.cnblogs.com/luolizhi/p/5059083.html
Copyright © 2020-2023  润新知