Without some example code to see (which I guess could be lengthy), my first guess is that something involving
thread collision is happening. Have you tried to make the notification method synchronized, or the block where the notification is called synchronized?