myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Howard W. Smith, Jr." <>
Subject Re: Help with java.lang.IllegalStateException: Cannot change buffer size after data has been written
Date Wed, 16 Jul 2014 14:33:49 GMT
On Wed, Jul 16, 2014 at 7:52 AM, Felipe Jaekel <> wrote:

> Not sure if this is this a MyFaces issue, but as I don't remember having it
> when my projects were running with with Mojarra, I'd like to see if you can
> help me.
> I'm eventually seeing this exception in my Tomcat 7.0.47 log:
> java.lang.IllegalStateException: Cannot change buffer size after data
> has been written
>         at
> org.apache.catalina.connector.ResponseFacade.setBufferSize(


I think I saw that error long time ago and I discussed with BalusC on/via
OmniFaces google-code project's issue tracker.

anyway, I think it was caused by the largest XHTML page in my app, which
has hundreds of UI components (<input/>, etc...).

Below, is what I saved in my web.xml per that discussion with BalusC.

    Comment 25 by project member balusc, Today (11 minutes ago)
    Just keep GZIP filter threshold size default. It has not the same
meaning as Facelets buffer size.

    A large Facelets buffer size may be useful during development, to spot
any bugs in the view which causes exceptions during render response. But I
would not set it that large in production.
    It's technically not possible to change the response when it has
already been committed.
    So if an exception occurs during rendering the response and the
response has already been committed,
    then you'll end up with a broken response. In most default
servletcontainer/webapp configurations,
    the response get committed when 2KB has already been written to the

    One of the ways to avoid this is to increase the response buffer size.
In Facelets,
    you can do this using the following context parameter (which sets it to
64KB, you may
    if necessary need to adjust it to the size of the largest HTML output
you have):


    Setting to 800KB, since /orders/pf_Add.xhtml (640+ KB) is the largest
    if this is not set, then OmniFaces 1.2 (OmniPartialViewContext) breaks
    see OmniFaces issue 73 (URL above)

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message