tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <>
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 <>:
> 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(
>        at org.apache.catalina.connector.ResponseFacade.getOutputStream(
>        at com.tirerack.filters.CompressionResponseStream.<init>(
>        at com.tirerack.filters.CompressionServletResponseWrapper.createOutputStream(
>        at com.tirerack.filters.CompressionServletResponseWrapper.getWriter(
>        at org.apache.jasper.runtime.JspWriterImpl.initOut(
>        at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(
>        at org.apache.jasper.runtime.PageContextImpl.release(
>        at org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(
>        at org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(
>        at org.apache.jsp.upgrade_005fgarage.SetCurrentVehicle_jsp._jspService(

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:
For additional commands, e-mail:

View raw message