java.lang.IllegalStateException: Cannot call sendRedirect() after the response has been committed
Somewhere in your code, enough output is written to the response stream to cause the output buffer to be flushed, sending the response headers - this constitutes commitment of the response since those headers can not be recalled.
So - your task is to figure out where that output gets written.
1. Decide whether it's necessary to redirect.
2. Redirect if it is necessary.
3. Otherwise, continue doing the servlet's actual work, including writing data to the response.