The IllegalMonitorStateException is thrown when a thread tries to perform an illegal operation on an object’s monitor. This can occur when a thread attempts to wait on an object it does not own or when it attempts to notify a thread not waiting on the object.
Find out how to find, avoid and fix