Loading ...
Sorry, an error occurred while loading the content.

Websphere 4.0.2 WriteBeyondContentLengthException

Expand Messages
  • smurphy999us
    Hi, We using XSLT to generate FOP on Webshpere 4.0.2. The FOP part looks like it works but the response.getOutputStream().write(content);
    Message 1 of 3 , Mar 5, 2003
    • 0 Attachment
      Hi,

      We using XSLT to generate FOP on Webshpere 4.0.2. The FOP part looks
      like it works but the
      response.getOutputStream().write(content);
      response.getOutputStream().flush();

      is giving us a
      com.ibm.servlet.engine.srt.WriteBeyondContentLengthException. The JSP
      is then blank. There are a couple of other weird parts. 1)Our write()
      and flush() statements are in a try/catch block. The exception is not
      getting caught in catch block. The stack is ending up in System.out.
      2)We can add other JSP code after the try/catch block that still gets
      executed.

      Has anyone seen this error before or have any ideas about fixing it?

      Thanks

      Steve
    • Chris Bowditch
      ... I think you need to call response.setContentLength prior to calling write and flush. There are a couple of other weird parts. 1)Our write() ... What is the
      Message 2 of 3 , Mar 6, 2003
      • 0 Attachment
        >From: "smurphy999us" <smurphy999us@...>
        >
        >We using XSLT to generate FOP on Webshpere 4.0.2. The FOP part looks
        >like it works but the
        > response.getOutputStream().write(content);
        > response.getOutputStream().flush();
        >
        >is giving us a
        >com.ibm.servlet.engine.srt.WriteBeyondContentLengthException. The JSP
        >is then blank.

        I think you need to call response.setContentLength prior to calling write
        and flush.

        There are a couple of other weird parts. 1)Our write()
        >and flush() statements are in a try/catch block. The exception is not
        >getting caught in catch block. The stack is ending up in System.out.

        What is the class name(s) in the catch block, Exception? Try catching
        Throwable, its the parent class of Exception, which also has Error has its
        sub-class

        _________________________________________________________________
        Chat online in real time with MSN Messenger http://messenger.msn.co.uk
      • rajug2000
        Even I set the content length in my struts action class I am getting the same error. Out is a ByteArrayOutputStream instance in the following code. Thanks,
        Message 3 of 3 , Oct 10, 2003
        • 0 Attachment
          Even I set the content length in my struts action class
          I am getting the same error. Out is a ByteArrayOutputStream instance
          in the following code.
          Thanks,
          Raju.
          response.setContentType("application/pdf");
          response.setContentLength(out.size());

          //Send content to Browser
          response.getOutputStream().write(out.toByteArray());
          response.getOutputStream().flush();
          out.close();
          System.out.println("Print request succeeded...");
        Your message has been successfully submitted and would be delivered to recipients shortly.