Job.getCounters() throws null pointer exception.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Job.getCounters() throws null pointer exception.

Kamoliddinov, Elbek

Hi Hadoop community.

We are using Hadoop 2.6.0 with cdh 5.13.1 and we are getting following NP exception when Job#getCounters() method is called:

java.lang.NullPointerException: null

                at org.apache.hadoop.mapreduce.counters.AbstractCounters.<init>(

                at org.apache.hadoop.mapreduce.Counters.<init>(

                at org.apache.hadoop.mapreduce.Job.getCounters(


I know job completed successfully and it has counters. I think RunningJob#getCounters() returning null and AbstractCounters’s constructor is trying to iterate over this null. What is the right way to get the Counters object from org.apache.hadoop.mapreduce.Job object that doesn’t fail? The thing is this works most of the time and fails once in a while.


Any idea of what might be causing this?