Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SRTServletRes W WARNING: Cannot set header. Response already committed.

1,357 views
Skip to first unread message

brett....@gmail.com

unread,
Dec 9, 2008, 1:01:51 AM12/9/08
to
Hi,

Can anyone tell me either, how I might fix the following issues or what is going on please? Details as follows.

I have a servlet filter that intercepts certain image requests and responds with a resized version of the image. This servlet filter is too complex to post, but I can tell you it works fine with Tomcat and WebLogic.

I just started working with WebSphere 6.1 for the first time and noticed two problems:

1. In a page containing 14 images typically, 2 or 3 would not load. This behaviour is not 100% repeatable in that if I reload the page, it will usually be a different 2 or 3 images that do not appear.

2. Regardless of whether or not the images load, I seem to get a lot of these warning messages:
SRTServletRes W WARNING: Cannot set header. Response already committed.

I came to the conclusion that my code was not responsible for attempting to set the header that generated the message because:
-I ensured my code was not setting the header at all
-A print statement I inserted at the end of my filter appeared in the logs before the warning message
-If I removed the command chain.doFilter(request, response) from my filter then the warning message stopped and all images would load correctly.

So, I can work around my problems by permanently removing chain.doFilter(request, response) from my code. However if possible, I would like a solution that enables me to chain the filter if necessary.

Thank you.

Regards Brett S

Ken Hygh

unread,
Dec 9, 2008, 9:02:01 AM12/9/08
to
Response Already Committed are often caused by trying to do a redirect,
generally to an error page. Since a redirect is actually setting a
header, you won't see it explicitly in your code.

Check the logs, and if you don't see anything there, make very sure that
none of your code silently swallows Exceptions.

Ken

peterwe...@gmail.com

unread,
May 7, 2009, 11:00:06 AM5/7/09
to
Hello BrettS,

Did you find any solution for this issue?

I'm having the same problem. If anyone can give any clue I will appreciate it.

Thanks in advance,
Peter

Brian S Paskin

unread,
May 7, 2009, 12:53:32 PM5/7/09
to
Hi, this usually indicates that a Servlet or JSP is trying to send more data to the output stream, but the output stream has already been committed.

Regards,
Brian

peterwe...@gmail.com

unread,
May 8, 2009, 9:52:53 AM5/8/09
to
Hello Brian,

Thanks for the answer!

Kind regards,
Peter

0 new messages