Women in Technology

Hear us Roar



Article:
  Two Servlet Filters Every Web Application Should Have
Subject:   GZip Filter, IBM WAS 5 -- Cannot set header. Response already committed
Date:   2004-02-05 14:26:13
From:   joyge
Jason, my name is George, and I'm working in a WAS 5 environment. I am trying to use your GZip Compression Filter but I am encountering some problems.


Oddly enough when I use the Compression filter in my WSAD 5 environment, it works perfectly. However when I deploy the same code into WAS 5, I receive an error indicating that the header cannot be set, because the response has already been committed. I assume that this error is the cause for IE 5.5 to trigger a popup indicating that I'm about to download a page. When I open the newly downloaded page, I see what appears to be compressed data.


To complicate the matter, I only receive this error on 1 page in my application. This is however not even close to an abnorammly long page, and it has similar code as all the other JSPs in our application. (FYI:Unfortunately I am not using STRUTS)


In both environments I've configured the filter to compress *.jsp, *.htm, *.html files.


In an attempt to resolve this issue, I grabbed the latest jspbook.jar file, dated 1-25-04, which contained an update to the GZipResponseStream.close() method which I thought would solve the problem.


Unfortunately to my dismay it did not fix this issue, but in fact it now occurs on a different page, but not the original page on which the error was occurring.


I was wondering if you have ever encountered an error similar to the one pasted below?


Any guidance would be greatly appreciated.


Thanks,
-George



2/4/04 11:35:50:803 EST] 20e6c662 SystemOut O writing...
[2/4/04 11:35:50:803 EST] 20e6c662 SystemOut O writing...
[2/4/04 11:35:53:737 EST] 20e6c662 TraceNLS u No message text associated with key WARNING:.Cannot.set.header..Response.already.committed. in bundle com.ibm.ejs.resources.seriousMessages
[2/4/04 11:35:53:736 EST] 20e6c662 SRTServletRes W WARNING: Cannot set header. Response already committed.
[2/4/04 11:35:53:777 EST] 20e6c662 TraceNLS u No message text associated with key WARNING:.Cannot.set.header..Response.already.committed. in bundle com.ibm.ejs.resources.seriousMessages
[2/4/04 11:35:53:777 EST] 20e6c662 SRTServletRes W WARNING: Cannot set header. Response already committed

Full Threads Oldest First

Showing messages 1 through 5 of 5.

  • GZip Filter, IBM WAS 5 -- Cannot set header. Response already committed
    2004-04-08 08:16:52  manivenkatachalam [View]

    Hi, I am getting the same error and my architecture is MVC1.

    I saw the response for this problem

    " Hi George, I saw this same warning on WAS 5 seemingly caused by one jsp forwarding to another, or in my case I had the filter turned on for both .jsp and servlets - I saw this warning when my servlet forwarded to a jsp. Since my webapp is a MVC type I really only have 1 servlet and it handles 99.9% of all requests, so I just turned the filter off for .jsp files and it went away. Well, mostly - I still see it sporadically when running under heavy load."


    I want to know how to turn the filter off for .jsp. Please help me on this and possible some sample code to do this. Please note that i am using struts.

    Thanks
    Mani
  • GZip Filter, IBM WAS 5 -- Cannot set header. Response already committed
    2004-04-08 08:16:50  manivenkatachalam [View]

    Hi, I am getting the same error and my architecture is MVC1.

    I saw the response for this problem

    " Hi George, I saw this same warning on WAS 5 seemingly caused by one jsp forwarding to another, or in my case I had the filter turned on for both .jsp and servlets - I saw this warning when my servlet forwarded to a jsp. Since my webapp is a MVC type I really only have 1 servlet and it handles 99.9% of all requests, so I just turned the filter off for .jsp files and it went away. Well, mostly - I still see it sporadically when running under heavy load."


    I want to know how to turn the filter off for .jsp. Please help me on this and possible some sample code to do this. Please note that i am using struts.

    Thanks
    Mani
  • GZip Filter, IBM WAS 5 -- Cannot set header. Response already committed
    2004-02-13 14:24:31  twinfeats [View]

    Hi George, I saw this same warning on WAS 5 seemingly caused by one jsp forwarding to another, or in my case I had the filter turned on for both .jsp and servlets - I saw this warning when my servlet forwarded to a jsp. Since my webapp is a MVC type I really only have 1 servlet and it handles 99.9% of all requests, so I just turned the filter off for .jsp files and it went away. Well, mostly - I still see it sporadically when running under heavy load.

    Not sure if that helps, but good luck!
    • GZip Filter, IBM WAS 5 -- Cannot set header. Response already committed
      2004-02-23 10:08:18  joyge [View]

      Thanks twinfeats, thanks for your suggestion. Unfortunately we are not using a true MVC design. Our design is more "page-centric", therefore your suggestion(which would be perfect if we had STRUTS) isn't going to solve our problem.

      We do in fact require page forwarding, which seems to be the root of the problem.

      It seems to me that the best solution is to address this issue directly with IBM. I will certainly pass on any helpful information that I receive to the group.

      Thanks again,
      - George Joy

      • GZip Filter, IBM WAS 5 -- Cannot set header. Response already committed
        2004-04-08 08:26:09  manivenkatachalam [View]

        Hi twinfeat,

        I am getting the same error and my architecture is MVC1.
        I saw the response for this problem

        " Hi George, I saw this same warning on WAS 5 seemingly caused by one jsp forwarding to another, or in my case I had the filter turned on for both .jsp and servlets - I saw this warning when my servlet forwarded to a jsp. Since my webapp is a MVC type I really only have 1 servlet and it handles 99.9% of all requests, so I just turned the filter off for .jsp files and it went away. Well, mostly - I still see it sporadically when running under heavy load."


        I want to know how to turn the filter off for .jsp. Please help me on this and possible some sample code to do this. Please note that i am using struts.

        Thanks
        Mani