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
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(){}