You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jeff Amiel <je...@gmail.com> on 2007/06/07 04:17:24 UTC

re-used Response instances causing me grief?

Have been battling a recent issue (outlined in some detail on the
struts mailing list)

http://www.mail-archive.com/user%40struts.apache.org/msg61515.html

In summary, unless their is some underlying bug that I cannot pinpoint
(always possible), my AxisServlet is being handed off a response that
is already committed (the response originally used by a struts
ActionServlet maybe......)

What I'm interested in finding out if indeed, re-used Response
instances could be the cause of my issue....and if simply stopping
their re-use (by  implementing a security manager or by tweaking the
Response.java code) is the correct solution.

Does this make any sense or should I still be trying to track down a
user code bug somewhere.....?

(running tomcat 5.5.20 under Jboss 4.X)

Any help would be appreciated.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: re-used Response instances causing me grief?

Posted by Mark Thomas <ma...@apache.org>.
Jeff Amiel wrote:
> Any advice or thoughts would be appreciated.

Bit of a long shot but it could be re-use of a RequestDispatcher.
Prior to 5.5.21 RD's were not thread-safe so if an RD is cached and
re-used that might explain what you see.

Mark

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: re-used Response instances causing me grief?

Posted by Jeff Amiel <je...@gmail.com>.
Shortly after this, while pouring through the tomcat issues
repository, I stumbled across this:

http://issues.apache.org/bugzilla/show_bug.cgi?id=41772

After reading,  I became more convinced that re-used response objects
was at the heart of my issue.  I searched high-and low through my user
code looking for anything that
might retain a handle to a response object....finding nothing obvious.
 Of course, such a bug could exist in any number of libraries we were
using....DWR, DisplayTag, etc.....

So.....I simply changed by startup config to run tomcat with a
-Djava.security.manager  option (my policy file allowing everything to
everybody).

And ...voila!  No more issue!!!.  (And yes...I m sure.  During a
period of time where we would have had dozens of these events
normally, we now have zero)

I am torn as to where to vent my displeasure (or even if I should have
any displeasure now that my production issue has 'gone away'. )

I notice that in Tomcat 6.0  that there is now an option for how the
Reponse and Request objects are recycled (not just when a Security
Manager is used).
http://mail-archives.apache.org/mod_mbox/tomcat-dev/200611.mbox/%3C20061103105626.622A11A9846@eris.apache.org%3E

There must be a reason for this.  While I'm sure there is some aspect
of my code (or the libraries that I am using) that is violating the
servlet specs by 'holding onto' the response and accessing it later, I
am distraught that Tomcat's default behavior is to permit this.  I'm
sure very few web applications out there are simple or stand-alone
enough to not use a plethora of third party libraries (like jasper
reports, jfreechart, displaytag, dwr, etc)...all of which might
represent an underlying 'threat' to that recycled response object.

I am still a bit concerned that I could not track my specific cause
down.....If it was something as innocuous as what was seen by the
submitter of the issue above, I would not be worried (garbage
collection calling flush on a un-closed stream)....but My issue could
be
worse.....sending data intended for one response (that is long gone)
to a different one...

Any advice or thoughts would be appreciated.

Jeff

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: re-used Response instances causing me grief?

Posted by Jeff Amiel <je...@gmail.com>.
On 6/6/07, Bill Barker <wb...@wilshire.com> wrote:

> It doesn't make sense.  The Facade delegates to the actual response always,
> so getting a new instance (the security manager option) won't help.  My
> first guess would be that somebody is doing a <jsp:include ... flush="true"

But how would that impact the AxisServlet?? those reposnses are being
written out to client connections (as SOAP messages)...not to a JSP
page.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: re-used Response instances causing me grief?

Posted by Bill Barker <wb...@wilshire.com>.
"Jeff Amiel" <je...@gmail.com> wrote in message 
news:a957db620706061917j5f5b4b3esdfa0f903b5315dc@mail.gmail.com...
> Have been battling a recent issue (outlined in some detail on the
> struts mailing list)
>
> http://www.mail-archive.com/user%40struts.apache.org/msg61515.html
>
> In summary, unless their is some underlying bug that I cannot pinpoint
> (always possible), my AxisServlet is being handed off a response that
> is already committed (the response originally used by a struts
> ActionServlet maybe......)
>
> What I'm interested in finding out if indeed, re-used Response
> instances could be the cause of my issue....and if simply stopping
> their re-use (by  implementing a security manager or by tweaking the
> Response.java code) is the correct solution.
>
> Does this make any sense or should I still be trying to track down a
> user code bug somewhere.....?
>

It doesn't make sense.  The Facade delegates to the actual response always, 
so getting a new instance (the security manager option) won't help.  My 
first guess would be that somebody is doing a <jsp:include ... flush="true" 
/>.

> (running tomcat 5.5.20 under Jboss 4.X)
>
> Any help would be appreciated.
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
> 




---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org