No such method exception Hadoop

后端 未结 6 857
长情又很酷
长情又很酷 2020-12-01 06:12

When I am running a Hadoop .jar file from the command prompt, it throws an exception saying no such method StockKey method.

StockKey is my custom class defined for m

6条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-01 07:14

    You have to provide an empty default constructor in your key class. Hadoop is using reflection and it can not guess any parameters to feed.

    So just add the default constructor:

    public StockKey(){}
    

提交回复
热议问题