tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "adapala venkta (JIRA)" <...@tapestry.apache.org>
Subject [jira] Created: (TAPESTRY-2693) File DownLoaing program getting exception as java.lang.IllegalStateException
Date Thu, 25 Sep 2008 07:19:44 GMT
File DownLoaing program getting exception as java.lang.IllegalStateException
----------------------------------------------------------------------------

                 Key: TAPESTRY-2693
                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2693
             Project: Tapestry
          Issue Type: Bug
    Affects Versions: 4.1.6
         Environment: Tapestry 4.1.6
            Reporter: adapala venkta
            Priority: Critical


Hai,

 i am writing a file Downloading progarm( Zip file). but i am getting an exception that  java.lang.IllegalStateException:
getWriter() has already been called for this response

Here is the sample code :

@InjectObject("service:tapestry.globals.HttpServletResponse")
  public abstract HttpServletResponse getHttpResponse();

 public void pageBeginRender(PageEvent pPageEvent)
  {

     HttpServletResponse httpServletResponse= getHttpResponse();
    InputStream fis = null;
      try
      {
        File f =new File("d:/sample.zip");
        httpServletResponse.setContentType("application/zip");
        httpServletResponse.setContentLength((int) f.length());
        httpServletResponse.setHeader("Content-Disposition", "attachment; filename="
            + f.getName());
        ServletOutputStream servletOut =(ServletOutputStream)httpServletResponse.getOutputStream();
        int read = -1;
        fis = new FileInputStream(f);
        byte b[] = new byte[fis.available()];
        read = fis.read(b);
        while (read != -1)
        {
          servletOut.write(b, 0, read);
          read = fis.read(b);
        }
        servletOut.flush();
      }
      catch (Exception e)
      {
        e.printStackTrace();
      }

Is there any other to do in tapestry 4.1.6

In the server console  i am geting that :

 java.lang.IllegalStateException: getWriter() has already been called for this response
12:01:31,988 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at org.apache.catalina.connector.Response.getOutputStream(Response.java:565)
12:01:31,988 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at org.apache.catalina.connector.ResponseFacade.getOutputStream(ResponseFacade.java:171)
12:01:31,988 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at com.ingenix.freya.web.pages.rulesmanagement.SaveExportRules.pageBeginRender(SaveExportRules.java:48)
12:01:31,988 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at org.apache.tapestry.AbstractPage.firePageBeginRender(AbstractPage.java:409)
12:01:31,988 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at org.apache.tapestry.AbstractPage.renderPage(AbstractPage.java:244)
12:01:31,988 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at org.apache.tapestry.engine.RequestCycle.renderPage(RequestCycle.java:397)
12:01:31,988 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at org.apache.tapestry.services.impl.DefaultResponseBuilder.renderResponse(DefaultResponseBuilder.java:151)
12:01:31,988 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at org.apache.tapestry.services.impl.ResponseRendererImpl.renderResponse(ResponseRendererImpl.java:33)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at $ResponseRenderer_11c98278a7d.renderResponse($ResponseRenderer_11c98278a7d.java)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at org.apache.tapestry.engine.DirectService.service(DirectService.java:147)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at $IEngineService_11c98278aee.service($IEngineService_11c98278aee.java)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at org.apache.tapestry.services.impl.EngineServiceOuterProxy.service(EngineServiceOuterProxy.java:72)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:241)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at org.apache.tapestry.services.impl.InvokeEngineTerminator.service(InvokeEngineTerminator.java:54)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at $WebRequestServicer_11c98278ac7.service($WebRequestServicer_11c98278ac7.java)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at $WebRequestServicer_11c98278ac3.service($WebRequestServicer_11c98278ac3.java)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at org.apache.tapestry.services.impl.WebRequestServicerPipelineBridge.service(WebRequestServicerPipelineBridge.java:61)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at $ServletRequestServicer_11c98278aa9.service($ServletRequestServicer_11c98278aa9.java)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at org.apache.tapestry.request.DecodedRequestInjector.service(DecodedRequestInjector.java:55)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at $ServletRequestServicerFilter_11c98278aa5.service($ServletRequestServicerFilter_11c98278aa5.java)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at $ServletRequestServicer_11c98278aab.service($ServletRequestServicer_11c98278aab.java)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at org.apache.tapestry.multipart.MultipartDecoderFilter.service(MultipartDecoderFilter.java:52)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at $ServletRequestServicerFilter_11c98278aa3.service($ServletRequestServicerFilter_11c98278aa3.java)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at $ServletRequestServicer_11c98278aab.service($ServletRequestServicer_11c98278aab.java)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at org.apache.tapestry.services.impl.SetupRequestEncoding.service(SetupRequestEncoding.java:53)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at $ServletRequestServicerFilter_11c98278aa7.service($ServletRequestServicerFilter_11c98278aa7.java)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at $ServletRequestServicer_11c98278aab.service($ServletRequestServicer_11c98278aab.java)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at $ServletRequestServicer_11c98278a9d.service($ServletRequestServicer_11c98278a9d.java)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:126)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at org.apache.tapestry.ApplicationServlet.doPost(ApplicationServlet.java:171)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at com.ingenix.freya.rulesdeployment.util.CredentialFilter.doFilter(CredentialFilter.java:38)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at org.josso.tc55.agent.SSOAgentValve.invoke(SSOAgentValve.java:730)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
12:01:32,019 INFO  (http-0.0.0.0-8080-6) [STDOUT] 	at java.lang.Thread.run(Thread.java:595)








-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


Mime
View raw message