tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steven Punte" <ste...@hamsoft.com>
Subject HELP: Use of OutputStream from JSP causes IllegalStateException
Date Fri, 28 Apr 2000 00:38:00 GMT
In order to output a binary image from a JSP file,
I'm using method calls on the ServletOutputStream
object obtained from response.getOutputStream().

Although it seems my JSP is operational, I keep
getting an exception in ~/logs/tomcat.log of basically:

        at java.lang.IllegalStateException.<init>(Compiled Code)
        at org.apache.tomcat.core.ResponseImpl.getWriter(Compiled Code)
        at
org.apache.tomcat.core.HttpServletResponseFacade.getWriter(Compiled Code)
        at org.apache.jasper.runtime.JspWriterImpl.initOut(Compiled Code)
        at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(Compiled
Code)
        at org.apache.jasper.runtime.JspWriterImpl.flush(Compiled Code)
        at
pages._0002fpages_0002fimage_0002ejspimage_jsp_8._jspService(Compiled Code)
                <The above line is my JSP page>

where the error message is "OutputStream is already being used for this
request".

I have tried using outputStream.close() and outputStream.flush()
to try to get rid of this problem, but with  no success.

At digging into this code, and looking at the above, it seems like a defect
in JspWriteImpl, in that it is trying to get another Writer on the
outputsteam
before the existing one is finished.

I've seen a lengthy earlier post that "seems" to be a similar problem,
but fundamentally was a overall system architecture issue.

Any suggestions here?




STeve Punte
e-Business Software Architect
Technologent Inc
stevep@technologent.com


Mime
View raw message