job.setOutputValueClass will set the types expected as output from both the map and reduce phases. In your code,
public static class Map extends Mapper<LongWritable, Text, IntWritable ,Text>
public static class Reduce extends Reducer<IntWritable, Text,IntWritable , IntWritable>
job.setOutputValueClass(IntWritable.class);
The mapper output value that is Text does not match with the outputValueClass that is IntWritable.Class since you are setting the property as job.setOutputValueClass(IntWritable.class); That is the reason it might give you Type mismatch error.
If your Mapper emits different types than the Reducer, you can set the types emitted by the mapper with the JobConf's setMapOutputKeyClass() and setMapOutputValueClass() methods. These implicitly sets the input types expected by the Reducer.