Hi,

we just tried porting  a larger application from 5.0.18 to 5.1.0.5.

One thing is causing troubles though. We use redirection in some cases to bring the user back to the start page if an error occurs.

This is how we do it in T5.1 (code from a sample Page to reproduce the NPE in a clean application)


        @Inject
        private Response response;
        
        @Inject
        private PageRenderLinkSource linkSource;

        @BeforeRenderTemplate
        public void beforeRender()
        {
                try
                {
                        response.sendRedirect(linkSource.createPageRenderLink(
                        Page1.class));
                }
                catch (IOException e)
                {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                }
                
        }

And this is the exception we get.

java.lang.NullPointerException
org .apache .tapestry5 .internal .services .ResponseCompressionAnalyzerImpl .isCompressable(ResponseCompressionAnalyzerImpl.java:65) $ ResponseCompressionAnalyzer_1219d91934e .isCompressable($ResponseCompressionAnalyzer_1219d91934e.java) org .apache .tapestry5 .internal .gzip .BufferedGZipOutputStream .openResponseOutputStream(BufferedGZipOutputStream.java:77) org .apache .tapestry5 .internal .gzip .BufferedGZipOutputStream .checkForCutover(BufferedGZipOutputStream.java:70) org .apache .tapestry5 .internal .gzip.BufferedGZipOutputStream.write(BufferedGZipOutputStream.java:116)
        sun.nio.cs.StreamEncoder$CharsetSE.writeBytes(StreamEncoder.java:336)
        sun.nio.cs.StreamEncoder$CharsetSE.implClose(StreamEncoder.java:427)
        sun.nio.cs.StreamEncoder.close(StreamEncoder.java:160)
        java.io.OutputStreamWriter.close(OutputStreamWriter.java:222)
        java.io.BufferedWriter.close(BufferedWriter.java:250)
        java.io.PrintWriter.close(PrintWriter.java:287)
org .apache .tapestry5 .internal .services .PageResponseRendererImpl .renderPageResponse(PageResponseRendererImpl.java:80) $ PageResponseRenderer_1219d91936f .renderPageResponse($PageResponseRenderer_1219d91936f.java) org .apache .tapestry5 .internal .services .DefaultRequestExceptionHandler .handleRequestException(DefaultRequestExceptionHandler.java:77) $ RequestExceptionHandler_1219d919358 .handleRequestException($RequestExceptionHandler_1219d919358.java) org .apache .tapestry5 .internal.services.RequestErrorFilter.service(RequestErrorFilter.java: 42)
        $RequestHandler_1219d91935a.service($RequestHandler_1219d91935a.java)
org.apache.tapestry5.services.TapestryModule $4.service(TapestryModule.java:778)
        $RequestHandler_1219d91935a.service($RequestHandler_1219d91935a.java)
org.apache.tapestry5.services.TapestryModule $3.service(TapestryModule.java:767)
        $RequestHandler_1219d91935a.service($RequestHandler_1219d91935a.java)
org .apache .tapestry5 .internal.services.StaticFilesFilter.service(StaticFilesFilter.java:85)
        $RequestHandler_1219d91935a.service($RequestHandler_1219d91935a.java)
org.apache.tapestry5.internal.services.CheckForUpdatesFilter $2.invoke(CheckForUpdatesFilter.java:90) org.apache.tapestry5.internal.services.CheckForUpdatesFilter $2.invoke(CheckForUpdatesFilter.java:81) org .apache .tapestry5 .ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:85) org .apache .tapestry5 .internal .services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:103)
        $RequestHandler_1219d91935a.service($RequestHandler_1219d91935a.java)
        $RequestHandler_1219d919350.service($RequestHandler_1219d919350.java)
org.apache.tapestry5.services.TapestryModule $HttpServletRequestHandlerTerminator.service(TapestryModule.java:197) org.apache.tapestry5.internal.gzip.GZipFilter.service(GZipFilter.java: 53) $ HttpServletRequestHandler_1219d919352 .service($HttpServletRequestHandler_1219d919352.java) org .apache .tapestry5 .internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java: 62) $ HttpServletRequestFilter_1219d91934f .service($HttpServletRequestFilter_1219d91934f.java) $ HttpServletRequestHandler_1219d919352 .service($HttpServletRequestHandler_1219d919352.java) org.apache.tapestry5.services.TapestryModule $2.service(TapestryModule.java:726) $ HttpServletRequestHandler_1219d919352 .service($HttpServletRequestHandler_1219d919352.java) $ HttpServletRequestHandler_1219d91934d .service($HttpServletRequestHandler_1219d91934d.java)
        org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:127)

Using jetty. the redirect works but is ugly in the logs. In tomcat, the Exception is presented to the user as a tomcat exception.

What can we do other than switching off compression all the way?

M.


Reply via email to