Consider multiple threads are trying to access critical section, what will happen one thread that occurs Exception inside a synchronized block it having wait() and notify() to
The synchronization monitor will be released: "If execution of the body is ever completed, either normally or abruptly, an unlock action is automatically performed on that same monitor." Java Language Specification 17.1. Synchronization.
Other threads will be able to continue synchronizing, and calling wait and notify.
If the thread with the exception is holding some critical program logic resource, you may need to use try-finally to ensure it is released.