InstantiationException in hadoop map reduce program InstantiationException in hadoop map reduce program hadoop hadoop

InstantiationException in hadoop map reduce program


job.setInputFormatClass(      org.apache.hadoop.mapreduce.lib.input.FileInputFormat.class);

You can't use / instantiate the FileInputFormat class: it's an abstract class.

If you want to parse the XML yourself then you'll need to write your own InputFormat that extends FileInputFormat, and the record reader can pass the entire contents to the mapper as the value. I think the Hadoop - The Definitive Guide has an example for WholeFileInputFormat, or something like that, or Google will probably have something: