tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: AJP connector is blocking JSON responses
Date Mon, 11 Aug 2014 01:04:02 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Omar,

On 8/10/14, 1:18 PM, Omar Belkhodja wrote:
> Finally, I almost understood the problem.
> 
> The framework was generating a response without a Content-Length
> header. The AJP connector seems to be adding it as a
> Content-Length=0, although if there are data.
> 
> So, currenly I have forced the framework to add the Content-Length
> header. In fact, it is spring and I added <property
> name="updateContentLength" value ="true"/> In the following
> configuration
> 
> <bean class= 
> "org.springframework.web.servlet.view.json.MappingJackson2JsonView">
>
> 
<property name="objectMapper" ref="jaxbJacksonObjectMapper"/>   <property
> name="updateContentLength" value="true"/> </bean>
> 
> Thank you for having helped in locating where is the problem.
> 
> For me, I have a workaround, but probably there is an issue on AJP
> (why adding the header with zero length ???)

If you aren't explicitly setting the Content-Length and the response
is not chunked, then some component is setting Content-Length to 0.
mod_jk is not to blame here: the application server (Tomcat or your
web application) is setting the Content-Length header to zero explicitly.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJT6BaCAAoJEBzwKT+lPKRYf1AP/Rhfrx1URnCxvP5b9cYcYEh2
M4TXhi+t648PyKWTyBkUtNn7/hfOTFAbidP8taC3kaat28l5PVT6RjK8F51PMrYo
IWB59Wr5Z90D4ofl+QzPyrJ3HVGvhcvXkI2mAQnV6y138FG2tjwNtoySnstNXCvi
SSOFVB1lib3EkJW5QsRpgsbtfFWDSWiQ1U72W5oMLQviU3KoBf2yDHoNWreCnLCf
l9T2j45h3wF1OoMSN7aEZAUkZEv2eVn4Tf5YVvvVBS/t1kUgH2uAYbry5cWvovv1
jJy4wxhfvXIqJDuIz4nDDty4nw+NDcLL4VvhYrgbrwh4lwn/AZfi2UpamdGnWt6L
/bL9ymvJ2GxndRfeUP3UuNTfgESpKpe/NU3ls/DW0N1pWlYnVIE/0nsBvph4mBVS
dLllDKRcAria6pzIxQaciFVZFfi9kvS6Pux4OSB1oeSkpPvpaaphFeYFJQgVR4iw
VW/iPC/SEgRlbVx0lBO6bf3tkG7rkinTY3FrMRv2GRxh1VKjFLUkLrc85igYYf9z
J2oob0r1+jH/RxvABW03Ed2sWjLd/e8ZJ50eioJtYGAsoOWVkAr0WXHPM3dTFV1u
5yK7ZZvq8fwUFzLjEVRf2mznN4Tnnsy3SOBo62axcPXg4iZSscDn73EkivGal2rw
AcHRwYuTXhnI+M967fwa
=43hf
-----END PGP SIGNATURE-----

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


Mime
View raw message