Wednesday, February 24, 2016

java.lang.RuntimeException: readObject can't find class

INFO mapred.JobClient: Task Id : attempt_201512031955_66234_m_00025_0, Status : FAILED
java.lang.RuntimeException: readObject can't find class
at org.apache.hadoop.mapreduce.lib.input.TaggedInputSplit.readClass(TaggedInputSplit.java:135)
at org.apache.hadoop.mapreduce.lib.input.TaggedInputSplit.readFields(TaggedInputSplit.java:121)
at org.apache.hadoop.io.serializer.WritableSerialization$WritableDeserializer.deserialize(WritableSerialization.java:73)
at org.apache.hadoop.io.serializer.WritableSerialization$WritableDeserializer.deserialize(WritableSerialization.java:44)
at org.apache.hadoop.mapred.MapTask.getSplitDetails(MapTask.java:356)
at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:640)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:330)
at org.apache.hadoop.mapred.Child$4.run(Child.java:268)
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:1438)
at org.apache.hadoop.mapred.Child.main(Child.java:262)


Possible Causes: 
1. Check if below line is present in the driver class 
      job.setJarByClass(MyDriver.class);  // This method sets the jar file in which each node will look for the Mapper and Reducer classes. if this is not present then you will see lots of FAILED Tasks in the job tracker.

2. Any other classes being set like combiner, partitioner. Check if they are properly set


   job.setPartitionerClass(CustomPartitioner.class);
   job.setCombinerClass(MyCombiner.class);