What could be the reason that CyclicBarrier.await() function generates a Null pointer Exception

219 Views Asked by At

I am using the CyclicBarrier class , await() to synchronize the different threads which process different documents simultaneously. However this function seems to return a Null pointer exception in most inputs of documents. Could someone help me out to avoid this exception?

1

There are 1 best solutions below

0
On

I see no reason this method should ever throw a NullPointerException, if you didn't use the version with a timeout and gave null as a time unit.

Are you sure the NullPointerException comes from this method? Have a look at the stack trace (or paste it into the question, if you can't interpret it).