Seems like the exception is thrown from this line.
out.println(e);
In case your code to send the PDF as Application fails during writing then it will thrown and exception and while trying to print the exception with the above line the outputputstream is already being used.
Do not intermix UI and Business Logic in JSP. Use a Servlet to do this job.