title: No such method exception Hadoop <init>
body: <p>When I am running a Hadoop .jar file from the command prompt, it throws an exception saying no such method StockKey method.</p>
  
  <p>StockKey is my custom class defined for my own type of key.</p>
  
  <p>Here is the exception:</p>
  
  <pre><code>12/07/12 00:18:47 INFO mapred.JobClient: Task Id :   
  attempt_201207082224_0007_m_000000_1, Status : FAILED
  
  java.lang.RuntimeException: java.lang.NoSuchMethodException: SecondarySort$StockKey.      
  &lt;init&gt;()
      at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:115)
      at org.apache.hadoop.io.WritableComparator.newKey(WritableComparator.java:109)
      at org.apache.hadoop.io.WritableComparator.&lt;init&gt;(WritableComparator.java:95)
      at org.apache.hadoop.io.WritableComparator.get(WritableComparator.java:51)
      at org.apache.hadoop.mapred.JobConf.getOutputKeyComparator(JobConf.java:795)
      at org.apache.hadoop.mapred.MapTask$MapOutputBuffer.&lt;init&gt;(MapTask.java:817)
      at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:383)
      at org.apache.hadoop.mapred.MapTask.run(MapTask.java:325)
      at org.apache.hadoop.mapred.Child$4.run(Child.java:270)
      at java.security.AccessController.doPrivileged(Native Method)
      at javax.security.auth.Subject.doAs(Subject.java:396)
      at     
     org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1127)
      at org.apache.hadoop.mapred.Child.main(Child.java:264)
  </code></pre>