tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <knst.koli...@gmail.com>
Subject Re: IllegalStateException using CompressionFilter with Tomcat 7.0.21/22
Date Tue, 04 Oct 2011 00:29:53 GMT
2011/10/4 Kari Scott <Kari.Scott@cdw.com>:
> SEVERE: Servlet.service() for servlet [jsp] in context with path [] threw exception [java.lang.IllegalStateException:
getWriter() has already been called for this response] with root cause
> java.lang.IllegalStateException: getWriter() has already been called for this response
>        at org.apache.catalina.connector.Response.getOutputStream(Response.java:594)
>        at org.apache.catalina.connector.ResponseFacade.getOutputStream(ResponseFacade.java:199)
>        at com.tirerack.filters.CompressionResponseStream.<init>(CompressionResponseStream.java:47)
>        at com.tirerack.filters.CompressionServletResponseWrapper.createOutputStream(CompressionServletResponseWrapper.java:172)
>        at com.tirerack.filters.CompressionServletResponseWrapper.getWriter(CompressionServletResponseWrapper.java:250)
>        at org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:125)
>        at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:118)
>        at org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.java:190)
>        at org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(JspFactoryImpl.java:123)
>        at org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(JspFactoryImpl.java:80)
>        at org.apache.jsp.upgrade_005fgarage.SetCurrentVehicle_jsp._jspService(SetCurrentVehicle_jsp.java:278)
>
>

The above stack trace is quite odd.
JspWriterImpl calls getWriter(), but CompressionServletResponseWrapper
implements it as a call to createOutputStream(), but that fails
because, well, you have already called getWriter().


It feels like there is some bug there, but I would like a more simple example.

I think it is OK to open an issue in Bugzilla, but please attach an
example (with source code) that reproduces this. I think a lot depends
on the state of JspWriterImpl when PageContextImpl.release() is
called.  I think it should be empty at that point, but it is not.

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message