Re: redirect problem in HttpClient

2004-10-09 Thread Oleg Kalnichevski
Zulfi,
According to the log the request body does get written to the socket
output stream:

[DEBUG] wire - - SOAP-ENV:Envelope 
...
ello/SOAP-ENV:Body/SOAP-ENV:Envelope

So, really I do not think this has anything to do with HttpClient given
the data.

Do try out different settings: CONTENT_LENGTH_AUTO and
CONTENT_LENGTH_CHUNKED and see if that makes any difference. 

I suggest you try to reproduce the problem using a simple (or as simple
as possible) test case, something which I could also run locally on my
machine. I am afraid we will be unable to help you unless you manage to
narrow the problem down, at least somewhat

Cheers,

Oleg



On Sat, 2004-10-09 at 00:10, Zulfi Umrani wrote:
 Hi Oleg,
 I am setting the request body as InputStream, but I do set the
 Content-Length header as well. I do print out the bytes for body as
 string before I call executeMethod and I do see the body being printed
 even for the transaction in question. The InputStream for body is
 created out of those bytes. I have enabled full wire(header and content)
 + context logging by setting the following properties. Log is once again
 attahced for the transaction in question. Let me know if I have to set
 some other property as well.
 
 System.setProperty(org.apache.commons.logging.Log,
 org.apache.commons.logging.impl.SimpleLog);
 System.setProperty(org.apache.commons.logging.simplelog.showdatetime,
 true);
 System.setProperty(org.apache.commons.logging.simplelog.log.httpclient.wire,
 debug);
 System.setProperty(org.apache.commons.logging.simplelog.log.org.apache.commons.httpclient,
 debug);
 
 
 Thanks,
 Zulfi
  [EMAIL PROTECTED] 10/8/2004 1:25:07 PM 
 Zulfi,
 
 My only guess is that this is a thread synchronization related
 problem,
 as the problem appears to be irregular. 
 
 How do you set the request body? As an InputStream? How do you set the
 content length? Explicitly or as CONTENT_LENGTH_AUTO? Can it be that
 the
 input stream is exhausted before HttpClient has a chance to send its
 content across the wire?
 
 Can you send me the context/wire log for the HTTP transaction in
 question?
 
 Oleg
 
 On Fri, 2004-10-08 at 22:10, Zulfi Umrani wrote:
  Hi Oleg,
  Yes, the connection is closed by the server. But it is closed
 because
  the HttpClient did not send it the request BODY. The problem is that
  occasionally HttpClient does not send the request as I described. For
 a
  few times, it does send the request and then it just doesnt send it,
 but
  only once. And then it is back to sending request body. The server
 tries
  to read the body but can not, hence it closes the connection for the
  reuqest which had no body and had Content-Length header value  1. I
  have sent you the reuqest in error from the tunnel. Looks like it
 sent
  the Content-Length header, but not the body of the request. 
  
  Hope this helps,
  Zulfi
   [EMAIL PROTECTED] 10/8/2004 12:46:04 PM 
  Zulfi
  
  HttpRecoverableException: Software caused connection abort: recv
  failed usually means that the connection was closed on the server
  side
  while HttpClient was still reading the response. The is more likely
 to
  be the server side problem. 
  
  What exactly do you mean by occasionally HttpClient does not send
 the
  request body. Does it throw an exception, or blocks, or something
  else?
  
  Oleg
   
  
  On Fri, 2004-10-08 at 19:53, Zulfi Umrani wrote:
   I am getting the following exception for redirect responses from
   HttpClient. Attached is the log from HttpClient. I know that
  HttpClient
   does not support redirect directly, hence we have written some
 code
  to
   handle that. The problem seems to be that, occasionally HttpClient
  does
   not send the request body though it writes out the Content-Length
   header. If you send the same request one after another by starting
 a
  new
   JVM for each request, such as running a client from commandline,
 you
   will see that, it sends the request body for a few times and then
 it
   does not send it once and then it starts to send it again. This
  behavior
   keeps repeating. Below is the request sent out by HttpClient and
   response received by it, captured through a tunnel. I will
 appreciate
  if
   someone can explain the behavior.
   
   Exception in thread main java.rmi.RemoteException:
   java.net.SocketException: S
   oftware caused connection abort: recv failed; nested exception is:
   org.apache.commons.httpclient.HttpRecoverableException:
   java.net.SocketE
   xception: Software caused connection abort: recv failed
   at
  
 
 com.sssw.jbroker.web.ServiceException.mapToRemote(ServiceException.ja
   va:92)
   at
  hello.HelloBinding_Stub.sayHello(HelloBinding_Stub.java:85)
   at hello.Client.main(Client.java:25)
   Caused by: org.apache.commons.httpclient.HttpRecoverableException:
   java.net.Sock
   etException: Software caused connection abort: recv failed
   at
  
 
 

DO NOT REPLY [Bug 31606] - Access to SO_TIMEOUT for open connections

2004-10-09 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=31606.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

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

Access to SO_TIMEOUT for open connections





--- Additional Comments From [EMAIL PROTECTED]  2004-10-09 10:49 ---
Gustavo,
Would it be possible that we address this problem in the next major release,
that is 4.0? 

Mike, any ideas how we could approach this problem? It is actually very trivial,
it just makes an already ugly API uglier.

Oleg

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 31607] - Catch SocketTimeoutException not InterruptedIOException

2004-10-09 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=31607.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

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

Catch SocketTimeoutException not InterruptedIOException

[EMAIL PROTECTED] changed:

   What|Removed |Added

   Severity|Blocker |Major
 Status|NEW |ASSIGNED
   Target Milestone|--- |3.0 Beta 1

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]