File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Error 500: OutputStream already obtained" Watch "Error 500: OutputStream already obtained" New topic

Error 500: OutputStream already obtained

Inna Rays

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.

Consultant, Sima Solutions
I agree. Here's the link:
subject: Error 500: OutputStream already obtained
It's not a secret anymore!