users@jersey.java.net

Re: [Jersey] read time-out when processing form post

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Mon, 09 Mar 2009 11:56:37 +0100

On Mar 3, 2009, at 10:00 PM, mmogley wrote:

>
> I'm posting this through a proxy servlet I wrote (in order to get
> around
> cross-domain security issues). I think you're right that it must be
> something on the server side, or in other words in my code. The actual
> method that sends the request is below.
>
> private void executeHttpMethod(HttpMethodBase httpMethod,
> HttpServletRequest request, HttpServletResponse response) throws
> IOException
> {
> try
> {
> httpMethod.setDoAuthentication(false);
>
> try
> {
> for (Enumeration<String> e = request.getHeaderNames();
> e.hasMoreElements();)
> {
> String headerName = e.nextElement();
> String headerValue = request.getHeader(headerName);
>
> httpMethod.setRequestHeader(headerName, headerValue);
> }
>
> int returnCode = m_httpClient.executeMethod(httpMethod);
>

It appears, from this code at least, that you are not copying the
bytes of the request from HttpServletRequest.getInputStream() to the
"httpMethod".

If the Apache HTTP client is invoking the Jersey code, specifically
the @POST method you have presented, then this would fit the problem
you describe, namely the Jersey server has no bytes to read becayse
your proxy did not send any.

Paul.