[ https://issues.apache.org/jira/browse/TAP5-673?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Howard M. Lewis Ship closed TAP5-673. ------------------------------------- Resolution: Incomplete Please add more information: a bit more of the code of that appears to be failing and the code that contributes your filter into the RequestHandler service configuration. What you've shown me should would, but its clear from the stack trace that the code is not returning and is dropping into the standard page rendering logic. Perhaps an exception occurred inside your filter. In any case, not enough to pursue ... reopen if you can provide more information. > An intercepted response causes the error "java.lang.IllegalStateException: > WRITER" in gzip compressed pages > ----------------------------------------------------------------------------------------------------------- > > Key: TAP5-673 > URL: https://issues.apache.org/jira/browse/TAP5-673 > Project: Tapestry 5 > Issue Type: Bug > Affects Versions: 5.1.0.4 > Reporter: Peter Stavrinides > > A small piece of code Inside of a standard tapestry RequestFilter: > // the user is logged in but does not have access to the > // requested resource > if (!hasAccess) { > logger_.warn("The user " + sessionAccess > > .getUserSecurityManager().getUserFullName() > + " attempted to access > a protected resource: " > + path); > > response.sendError(HttpServletResponse.SC_FORBIDDEN, > "Access to the > requested resource is denied"); > return true; > } > Causes this error: > > Stack Trace: > ERROR - WRITER > - com.albourne.web.services.SiteRequestExceptionHandler (?) > java.lang.IllegalStateException: WRITER > at org.mortbay.jetty.Response.getOutputStream(Response.java:573) > at > org.apache.tapestry5.internal.gzip.BufferedGZipOutputStream.openResponseOutputStream(BufferedGZipOutputStream.java:75) > at > org.apache.tapestry5.internal.gzip.BufferedGZipOutputStream.forceOutputStream(BufferedGZipOutputStream.java:137) > at > org.apache.tapestry5.internal.gzip.BufferedGZipOutputStream.close(BufferedGZipOutputStream.java:131) > at sun.nio.cs.StreamEncoder.implClose(StreamEncoder.java:301) > at sun.nio.cs.StreamEncoder.close(StreamEncoder.java:130) > at java.io.OutputStreamWriter.close(OutputStreamWriter.java:216) > at java.io.BufferedWriter.close(BufferedWriter.java:248) > at java.io.PrintWriter.close(PrintWriter.java:295) > at > org.apache.tapestry5.internal.services.PageResponseRendererImpl.renderPageResponse(PageResponseRendererImpl.java:80) > at > $PageResponseRenderer_120f158d8a3.renderPageResponse($PageResponseRenderer_120f158d8a3.java) > at > org.apache.tapestry5.internal.services.PageRenderRequestHandlerImpl.handle(PageRenderRequestHandlerImpl.java:63) > at > org.apache.tapestry5.services.TapestryModule$33.handle(TapestryModule.java:1948) > at > $PageRenderRequestHandler_120f158d8a4.handle($PageRenderRequestHandler_120f158d8a4.java) > at > $PageRenderRequestHandler_120f158d88f.handle($PageRenderRequestHandler_120f158d88f.java) > at > org.apache.tapestry5.internal.services.ComponentRequestHandlerTerminator.handlePageRender(ComponentRequestHandlerTerminator.java:48) > at > $ComponentRequestHandler_120f158d894.handlePageRender($ComponentRequestHandler_120f158d894.java) > at > org.apache.tapestry5.internal.services.PageRenderDispatcher.dispatch(PageRenderDispatcher.java:45) > at $Dispatcher_120f158d897.dispatch($Dispatcher_120f158d897.java) > at $Dispatcher_120f158d88a.dispatch($Dispatcher_120f158d88a.java) > at > org.apache.tapestry5.services.TapestryModule$RequestHandlerTerminator.service(TapestryModule.java:250) > at > com.albourne.web.services.PageAccessController.service(PageAccessController.java:199) > at $RequestHandler_120f158d88b.service($RequestHandler_120f158d88b.java) > at com.albourne.web.services.AppModule$3.service(AppModule.java:209) > at $RequestFilter_120f158d889.service($RequestFilter_120f158d889.java) > at $RequestHandler_120f158d88b.service($RequestHandler_120f158d88b.java) > at > org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:26) > at $RequestHandler_120f158d88b.service($RequestHandler_120f158d88b.java) > at > org.apache.tapestry5.services.TapestryModule$4.service(TapestryModule.java:783) > at $RequestHandler_120f158d88b.service($RequestHandler_120f158d88b.java) > at > org.apache.tapestry5.services.TapestryModule$3.service(TapestryModule.java:772) > at $RequestHandler_120f158d88b.service($RequestHandler_120f158d88b.java) > at > org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:85) > at $RequestHandler_120f158d88b.service($RequestHandler_120f158d88b.java) > at > org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:90) > at > org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:81) > at > org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:85) > at > org.apache.tapestry5.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:103) > at $RequestHandler_120f158d88b.service($RequestHandler_120f158d88b.java) > at $RequestHandler_120f158d883.service($RequestHandler_120f158d883.java) > at > org.apache.tapestry5.services.TapestryModule$HttpServletRequestHandlerTerminator.service(TapestryModule.java:202) > at > org.apache.tapestry5.internal.gzip.GZipFilter.service(GZipFilter.java:53) > at > $HttpServletRequestHandler_120f158d885.service($HttpServletRequestHandler_120f158d885.java) > at > org.apache.tapestry5.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62) > at > $HttpServletRequestFilter_120f158d882.service($HttpServletRequestFilter_120f158d882.java) > at > $HttpServletRequestHandler_120f158d885.service($HttpServletRequestHandler_120f158d885.java) > at > org.apache.tapestry5.services.TapestryModule$2.service(TapestryModule.java:731) > at > $HttpServletRequestHandler_120f158d885.service($HttpServletRequestHandler_120f158d885.java) > at > $HttpServletRequestHandler_120f158d880.service($HttpServletRequestHandler_120f158d880.java) > at org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:127) > at > org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) > at > org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:387) > at > org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) > at > org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) > at > org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) > at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417) > at > org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) > at > org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) > at > org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) > at org.mortbay.jetty.Server.handle(Server.java:324) > at > org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:535) > at > org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:865) > at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:539) > at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) > at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) > at > org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409) > at > org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520) > 2009-04-29 13:13:46.141::WARN: /castle/hf/risk/selectcompare/180 > java.lang.IllegalStateException: WRITER > 127.0.0.1 - - [29/Apr/2009:10:13:46 +0000] "GET /castle/CSS/castle.css > HTTP/1.1" 200 5634 "http://localhost:8080/castle/hf/risk/selectcompare/180" > "Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9.0.10) Gecko/2009042513 > Ubuntu/8.04 (hardy) Firefox/3.0.10" > at org.mortbay.jetty.Response.getOutputStream(Response.java:573) > at > org.apache.tapestry5.internal.gzip.BufferedGZipOutputStream.openResponseOutputStream(BufferedGZipOutputStream.java:75) > at > org.apache.tapestry5.internal.gzip.BufferedGZipOutputStream.checkForCutover(BufferedGZipOutputStream.java:70) > at > org.apache.tapestry5.internal.gzip.BufferedGZipOutputStream.write(BufferedGZipOutputStream.java:116) > at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:202) > at sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:263) > at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:106) > at java.io.OutputStreamWriter.write(OutputStreamWriter.java:190) > at java.io.BufferedWriter.flushBuffer(BufferedWriter.java:111) > at java.io.BufferedWriter.write(BufferedWriter.java:212) > at java.io.PrintWriter.write(PrintWriter.java:412) > at java.io.PrintWriter.write(PrintWriter.java:429) > at java.io.PrintWriter.print(PrintWriter.java:559) > at org.apache.tapestry5.dom.Text.toMarkup(Text.java:59) > at org.apache.tapestry5.dom.Element.writeChildMarkup(Element.java:840) > at org.apache.tapestry5.dom.Element.toMarkup(Element.java:356) > at org.apache.tapestry5.dom.Element.writeChildMarkup(Element.java:840) > 127.0.0.1 - - [29/Apr/2009:10:13:46 +0000] "GET > /castle/images/albournelogo.gif HTTP/1.1" 200 1147 > "http://localhost:8080/castle/hf/risk/selectcompare/180" "Mozilla/5.0 (X11; > U; Linux i686; en-GB; rv:1.9.0.10) Gecko/2009042513 Ubuntu/8.04 (hardy) > Firefox/3.0.10" > at org.apache.tapestry5.dom.Element.toMarkup(Element.java:356) > at org.apache.tapestry5.dom.Element.writeChildMarkup(Element.java:840) > at org.apache.tapestry5.dom.Element.toMarkup(Element.java:356) > at org.apache.tapestry5.dom.Element.writeChildMarkup(Element.java:840) > at org.apache.tapestry5.dom.Element.toMarkup(Element.java:356) > at org.apache.tapestry5.dom.Element.writeChildMarkup(Element.java:840) > at org.apache.tapestry5.dom.Element.toMarkup(Element.java:356) > at org.apache.tapestry5.dom.Element.writeChildMarkup(Element.java:840) > at org.apache.tapestry5.dom.Element.toMarkup(Element.java:356) > at org.apache.tapestry5.dom.Element.writeChildMarkup(Element.java:840) > at org.apache.tapestry5.dom.Element.toMarkup(Element.java:356) > at org.apache.tapestry5.dom.Document.toMarkup(Document.java:163) > at org.apache.tapestry5.dom.Node.toMarkup(Node.java:80) > at > org.apache.tapestry5.internal.services.MarkupWriterImpl.toMarkup(MarkupWriterImpl.java:57) > at > org.apache.tapestry5.internal.services.PageResponseRendererImpl.renderPageResponse(PageResponseRendererImpl.java:67) > at > $PageResponseRenderer_120f158d8a3.renderPageResponse($PageResponseRenderer_120f158d8a3.java) > at > com.albourne.web.services.SiteRequestExceptionHandler.handleRequestException(Unknown > Source) > at > $RequestExceptionHandler_120f158d863.handleRequestException($RequestExceptionHandler_120f158d863.java) > at > org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:42) > at $RequestHandler_120f158d88b.service($RequestHandler_120f158d88b.java) > at > org.apache.tapestry5.services.TapestryModule$4.service(TapestryModule.java:783) > at $RequestHandler_120f158d88b.service($RequestHandler_120f158d88b.java) > at > org.apache.tapestry5.services.TapestryModule$3.service(TapestryModule.java:772) > at $RequestHandler_120f158d88b.service($RequestHandler_120f158d88b.java) > at > org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:85) > at $RequestHandler_120f158d88b.service($RequestHandler_120f158d88b.java) > at > org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:90) > at > org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:81) > at > org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:85) > at > org.apache.tapestry5.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:103) > at $RequestHandler_120f158d88b.service($RequestHandler_120f158d88b.java) > at $RequestHandler_120f158d883.service($RequestHandler_120f158d883.java) > at > org.apache.tapestry5.services.TapestryModule$HttpServletRequestHandlerTerminator.service(TapestryModule.java:202) > at > org.apache.tapestry5.internal.gzip.GZipFilter.service(GZipFilter.java:53) > at > $HttpServletRequestHandler_120f158d885.service($HttpServletRequestHandler_120f158d885.java) > at > org.apache.tapestry5.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62) > at > $HttpServletRequestFilter_120f158d882.service($HttpServletRequestFilter_120f158d882.java) > at > $HttpServletRequestHandler_120f158d885.service($HttpServletRequestHandler_120f158d885.java) > at > org.apache.tapestry5.services.TapestryModule$2.service(TapestryModule.java:731) > at > $HttpServletRequestHandler_120f158d885.service($HttpServletRequestHandler_120f158d885.java) > at > $HttpServletRequestHandler_120f158d880.service($HttpServletRequestHandler_120f158d880.java) > at org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:127) > at > org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) > at > org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:387) > at > org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) > at > org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) > at > org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) > at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417) > at > org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) > at > org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) > at > org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) > at org.mortbay.jetty.Server.handle(Server.java:324) > at > org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:535) > at > org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:865) > at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:539) > at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) > at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) > at > org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409) > at > org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520) > This was introduced with the introduction of gzip compressed pages. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.