You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by John Dunne <jo...@alldunne.com> on 2010/03/31 11:51:30 UTC

Tomcat not serving large content?

Hi,

 

I'm using tomcat 5.5.28 to serve an XML document (an RSS feed actually) via
a servlet. An RSS client makes the request via a HTTP POST request, and I
can see the servlet serves the entire XML document, however, the RSS client
for some reason does not receive a complete document. I've assumed that this
is to do with a configurable limit in the tomcat server, and after searching
high and low on Google I've come here to see if anyone can shed some light
on this elusive (at least for me) property. 

 

Thank you for your time in reading this mail!!

 

John.

 


Re: Tomcat not serving large content?

Posted by Pid <pi...@pidster.com>.
On 31/03/2010 15:11, John Dunne wrote:
> When I download the file in a browser, the XML content is incomplete and so
> the browser just complains of receiving a malformed XML document. This is
> the same for several browsers.

How many bytes do you get?  Is it the same amount each time?

Have to ask: is it possible that the whole file is downloaded, but that 
the rendering stops at a specific point because there's malformed content?


Can you enable the RequestDumperValve?

  http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html


p

> The Servlet is sending the document to the client via Rome java rss library.
> Rome polls the XML feed from the source and then serves the XML document via
> the HttpServletResponse.getWriter() method and SyndFeedOutput, a Rome class
> that is used to write the XML document to the PrintWriter.
>
> I've made sure the flush method is called.
>
> I've also tried, from within the Servlet, reading the XML document from its
> source and then sending the XML document in the response line by line (in
> effect just using a StringBuffer to store the XML document, and then
> splitting the StringBuffer into lines, and sending these using the
> response.getWriter().println() method) to make sure that the XML document is
> actually being sent to the PrintWriter, which it is.
>
> So something occurring after the PrintWriter.println() method is called is
> stopping the entire data from making it to the client. Hence my thinking
> that it's the Tomcat server not liking the amount of data being sent in the
> response??



And you don't



> -----Original Message-----
> From: Pid [mailto:pid@pidster.com]
> Sent: 31 March 2010 14:43
> To: users@tomcat.apache.org
> Subject: Re: Tomcat not serving large content?
>
> On 31/03/2010 14:37, John Dunne wrote:
>> Hi Pid,
>>
>> Thanks for your reply.
>>
>> The file is 140 kilobytes.
>
> That's not really very large and certainly not large enough for the size
> to be an interesting factor.
>
> What happens if you download the file in a browser?
>
> How is the Servlet sending it, by a forward to the real location or by
> generating it dynamically and sending the bytes?
>
>
> p
>
>
>
>> -----Original Message-----
>> From: Pid [mailto:pid@pidster.com]
>> Sent: 31 March 2010 13:20
>> To: users@tomcat.apache.org
>> Subject: Re: Tomcat not serving large content?
>>
>> On 31/03/2010 10:51, John Dunne wrote:
>>> Hi,
>>>
>>> I'm using tomcat 5.5.28 to serve an XML document (an RSS feed actually)
>> via
>>> a servlet. An RSS client makes the request via a HTTP POST request, and I
>>> can see the servlet serves the entire XML document, however, the RSS
>> client
>>> for some reason does not receive a complete document. I've assumed that
>> this
>>> is to do with a configurable limit in the tomcat server, and after
>> searching
>>> high and low on Google I've come here to see if anyone can shed some
> light
>>> on this elusive (at least for me) property.
>>>
>>> Thank you for your time in reading this mail!!
>>
>> How big, exactly, is the file or data sent?
>>
>>
>> p
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>


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


RE: Tomcat not serving large content?

Posted by John Dunne <jo...@alldunne.com>.
When I download the file in a browser, the XML content is incomplete and so
the browser just complains of receiving a malformed XML document. This is
the same for several browsers. 

The Servlet is sending the document to the client via Rome java rss library.
Rome polls the XML feed from the source and then serves the XML document via
the HttpServletResponse.getWriter() method and SyndFeedOutput, a Rome class
that is used to write the XML document to the PrintWriter.

I've made sure the flush method is called. 

I've also tried, from within the Servlet, reading the XML document from its
source and then sending the XML document in the response line by line (in
effect just using a StringBuffer to store the XML document, and then
splitting the StringBuffer into lines, and sending these using the
response.getWriter().println() method) to make sure that the XML document is
actually being sent to the PrintWriter, which it is. 

So something occurring after the PrintWriter.println() method is called is
stopping the entire data from making it to the client. Hence my thinking
that it's the Tomcat server not liking the amount of data being sent in the
response??

Thanks again Pid.

-----Original Message-----
From: Pid [mailto:pid@pidster.com] 
Sent: 31 March 2010 14:43
To: users@tomcat.apache.org
Subject: Re: Tomcat not serving large content?

On 31/03/2010 14:37, John Dunne wrote:
> Hi Pid,
>
> Thanks for your reply.
>
> The file is 140 kilobytes.

That's not really very large and certainly not large enough for the size 
to be an interesting factor.

What happens if you download the file in a browser?

How is the Servlet sending it, by a forward to the real location or by 
generating it dynamically and sending the bytes?


p



> -----Original Message-----
> From: Pid [mailto:pid@pidster.com]
> Sent: 31 March 2010 13:20
> To: users@tomcat.apache.org
> Subject: Re: Tomcat not serving large content?
>
> On 31/03/2010 10:51, John Dunne wrote:
>> Hi,
>>
>> I'm using tomcat 5.5.28 to serve an XML document (an RSS feed actually)
> via
>> a servlet. An RSS client makes the request via a HTTP POST request, and I
>> can see the servlet serves the entire XML document, however, the RSS
> client
>> for some reason does not receive a complete document. I've assumed that
> this
>> is to do with a configurable limit in the tomcat server, and after
> searching
>> high and low on Google I've come here to see if anyone can shed some
light
>> on this elusive (at least for me) property.
>>
>> Thank you for your time in reading this mail!!
>
> How big, exactly, is the file or data sent?
>
>
> p
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>


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



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


Re: Tomcat not serving large content?

Posted by Pid <pi...@pidster.com>.
On 31/03/2010 14:37, John Dunne wrote:
> Hi Pid,
>
> Thanks for your reply.
>
> The file is 140 kilobytes.

That's not really very large and certainly not large enough for the size 
to be an interesting factor.

What happens if you download the file in a browser?

How is the Servlet sending it, by a forward to the real location or by 
generating it dynamically and sending the bytes?


p



> -----Original Message-----
> From: Pid [mailto:pid@pidster.com]
> Sent: 31 March 2010 13:20
> To: users@tomcat.apache.org
> Subject: Re: Tomcat not serving large content?
>
> On 31/03/2010 10:51, John Dunne wrote:
>> Hi,
>>
>> I'm using tomcat 5.5.28 to serve an XML document (an RSS feed actually)
> via
>> a servlet. An RSS client makes the request via a HTTP POST request, and I
>> can see the servlet serves the entire XML document, however, the RSS
> client
>> for some reason does not receive a complete document. I've assumed that
> this
>> is to do with a configurable limit in the tomcat server, and after
> searching
>> high and low on Google I've come here to see if anyone can shed some light
>> on this elusive (at least for me) property.
>>
>> Thank you for your time in reading this mail!!
>
> How big, exactly, is the file or data sent?
>
>
> p
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>


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


RE: Tomcat not serving large content?

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: John Dunne [mailto:john@alldunne.com]
> Subject: RE: Tomcat not serving large content?
> 
> The file is 140 kilobytes.

That's actually relatively small - should not be a problem.  Tomcat doesn't limit the response size, but whatever you're using to serve the content might be.  Running Wireshark or equivalent on both the client and server might help to figure out where the content is being lost.

> I can see the servlet serves the entire XML document

How do you determine the above?

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


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


Re: Tomcat not serving large content?

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

John,

On 3/31/2010 9:37 AM, John Dunne wrote:
> The file is 140 kilobytes.

Tomcat has no limitations on response size: it's all streaming as far as
Tomcat is concerned. We routinely send large static and dynamic
documents through Tomcat 5.5.25/26 without a problem.

> On 31/03/2010 10:51, John Dunne wrote:
>> I'm using tomcat 5.5.28 to serve an XML document (an RSS feed 
>> actually) via a servlet. An RSS client makes the request via a HTTP
>> POST request, and I can see the servlet serves the entire XML
>> document, however, the RSS client for some reason does not receive
>> a complete document. I've assumed that this is to do with a
>> configurable limit in the tomcat server, and after searching high
>> and low on Google I've come here to see if anyone can shed some
>> light on this elusive (at least for me) property.

Can you confirm with a packet sniffer that the entire document is being
sent across the wire? I wonder if you just need to add an out.flush() at
the end of the whole thing.

Another possibility is that you are sending the wrong Content-Length.
Are you computing your own Content-Length and sending it? You might want
to check it against the actual number of bytes you are sending to the
client. Remember: Content-Length is in bytes, not characters. If you're
using a character encoding that uses more than 1 byte per character, you
may be sending a Content-Length that is too small to the client.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkuzUwEACgkQ9CaO5/Lv0PB7OQCgvjIHkuzS4q8RN/qIQK0oXgpm
80cAnRfpA6NKN45f2CfnRTwpIcDwDOo9
=Aelz
-----END PGP SIGNATURE-----

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


RE: Tomcat not serving large content?

Posted by John Dunne <jo...@alldunne.com>.
Hi Pid,

Thanks for your reply.

The file is 140 kilobytes.

-----Original Message-----
From: Pid [mailto:pid@pidster.com] 
Sent: 31 March 2010 13:20
To: users@tomcat.apache.org
Subject: Re: Tomcat not serving large content?

On 31/03/2010 10:51, John Dunne wrote:
> Hi,
>
> I'm using tomcat 5.5.28 to serve an XML document (an RSS feed actually)
via
> a servlet. An RSS client makes the request via a HTTP POST request, and I
> can see the servlet serves the entire XML document, however, the RSS
client
> for some reason does not receive a complete document. I've assumed that
this
> is to do with a configurable limit in the tomcat server, and after
searching
> high and low on Google I've come here to see if anyone can shed some light
> on this elusive (at least for me) property.
>
> Thank you for your time in reading this mail!!

How big, exactly, is the file or data sent?


p

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



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


Re: Tomcat not serving large content?

Posted by Pid <pi...@pidster.com>.
On 31/03/2010 10:51, John Dunne wrote:
> Hi,
>
> I'm using tomcat 5.5.28 to serve an XML document (an RSS feed actually) via
> a servlet. An RSS client makes the request via a HTTP POST request, and I
> can see the servlet serves the entire XML document, however, the RSS client
> for some reason does not receive a complete document. I've assumed that this
> is to do with a configurable limit in the tomcat server, and after searching
> high and low on Google I've come here to see if anyone can shed some light
> on this elusive (at least for me) property.
>
> Thank you for your time in reading this mail!!

How big, exactly, is the file or data sent?


p

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