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
There's another thing to check when getting errors like this for classes which are writables, mappers, reducers, etc.
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.