Two Laptop Bag*
The moose likes Struts and the fly likes Error 500: OutputStream already obtained Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Error 500: OutputStream already obtained" Watch "Error 500: OutputStream already obtained" New topic
Author

Error 500: OutputStream already obtained

Inna Rays
Greenhorn

Joined: Mar 16, 2006
Posts: 1
"Error 500: OutputStream already obtained" is happenning after websphere application using tiles and struts is calling a class to create an excel sheet with a null return after flushing the output. What should be done to avoid this error appearing in the Microsoft Excell document where the output is written?

FastExcelCSVPrinter fecp =
new FastExcelCSVPrinter(response.getOutputStream());
if (export(l, fecp))
{
fecp.flush();return null; //return null on success.
}
[ March 16, 2006: Message edited by: Inna Rays ]
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
What this error indicates is that at some point prior to this call, another process has already written to the output steam, and this isn't allowed.

You have to make this call before any other process has a chance to attempt to write to the output stream. One thing you may want to check is that the call to this action should not be part of a tile definition.


Merrill
Consultant, Sima Solutions
 
 
subject: Error 500: OutputStream already obtained