Category: | General |
Priority: | Normal |
Status: | Feedback Requested |
Project: | Severity: | Major |
Resolution: | Open |
|
Component: | Reproducibility: | Always |
Assigned to: |
Create minimal report with only detail band with a simple barcode (barcode4j) code128 with fixed code "123456789"
Link org.krisalis barcode4j.jar ver2.1 in lib directory of web application
After compile and fill the report the servlet out with:
JasperExportManager.exportReportToPdfStream(jp, response.getOutputStream());
and error in tomcat is:
getOutputStream() has already been called for this response
seem that are no stream in response.
If i delete barcode component and add a simple text component all run correctly and servlet response with pdf stream in browser
How i can print barcode ?
v6.16.0
Barcode4j
2 Comments:
With barbecue all run ok
I'm not sure this is related to JasperReports. This is a common servlet/JSP issue which occurs when output has already started to be sent to the response and the program tries to acquire the output stream again.
It usually happens with JSP files which have some blank space in them and thus start to write them to the response before the program tries to get the output stream and write bytes to it.
The best way to solve this is to use a servlet and make sure it writes to the response output only in one place.
I hope this helps.
Teodor