If you are developing a jsp that output a pdf with iText, you could bump into the error: Error 500: OutputStream already obtained.
In order to avoid this error, simply ensure to remove all spaces, and new lines from jsp tags, for example this brief code will generate the error
<%@ page import="..." %> <% ... %>
and this will work (beware I’ve removed the newline between jsp tags)
<%@ page import="..." %><% ... %>
Here is a sample working jsp.