I spoke too soon when I said that everything works fine now. For any but the smallest files, HttpClient times out while waiting for the 100 Continue response from the server. A log is attached; they all look like this. If I had to guess, I would speculate that IIS is preallocating a file to receive the PUT data. In any event, the timeout of three seconds (RESPONSE_WAIT_TIME_MS) is apparently a hardcoded constant and cannot be changed. So what's a boy to do?
--Matthew Beermann
----- Original Message ----- From: "Adrian Sutton" <[EMAIL PROTECTED]>
To: "Jakarta Commons Users List" <[EMAIL PROTECTED]>
Sent: Monday, August 16, 2004 4:04 PM
Subject: RE: [HttpClient] Problems with PUT and NTLM
Hi all,
Slide uses a subclass of HttpState as I recall. The subclass obviously has:
public boolean isAuthenticationPreemtive() {
return true;
}which would explain the behaviour you're seeing.
Regards,
Adrian Sutton.
-----Original Message----- From: Oleg Kalnichevski [mailto:[EMAIL PROTECTED] Sent: Tuesday, 17 August 2004 7:02 AM To: Jakarta Commons Users List Subject: Re: [HttpClient] Problems with PUT and NTLM
client.getState().setAuthenticationPreemptive(false);
work theSystem.out.println(client.getState().isAuthenticationPreemptive());
...and got back "true", which confuses me completely. Does this not
way I think it does? I'd really like to ditch the wasted Basic:
attempts.
Matthew,
Certainly this is not the way it is meant to be
I am not sure if [Slide] uses a stock version of HttpClient or a forked one, but I know for a fact that in the stock version the preemptive authentication is disabled per default. When not explicitly turned on the preemptive authentication is not used
Moreover, here's the verbatim copy of the HttpState#*AuthenticationPreemptive methods implementation.
public void setAuthenticationPreemptive(boolean value) {
this.preemptive = value;
}
public boolean isAuthenticationPreemptive() { return this.preemptive; }
I just do not see how what you are saying is possible if the source code has not been tampered with.
Try replacing the jar that comes with [Slide] with the latest stable release of HttpClient (version 2.0.1 as of writing) and see if that makes any difference
Oleg
On Mon, 2004-08-16 at 22:02, Matthew Beermann wrote:
A full log is attached. Turning on the expect-continue handshake doesindeed
solve the problem (as seen in log #2). However, I still have aquestion
after looking at the logs: I tried putting these two lines one rightafter
work thethe other:
client.getState().setAuthenticationPreemptive(false); System.out.println(client.getState().isAuthenticationPreemptive());
...and got back "true", which confuses me completely. Does this not
way I think it does? I'd really like to ditch the wasted Basic:attempts.
actually
--Matthew Beermann
----- Original Message ----- From: "Oleg Kalnichevski" <[EMAIL PROTECTED]>
To: "Jakarta Commons Users List" <[EMAIL PROTECTED]>
Sent: Friday, August 13, 2004 5:11 PM
Subject: Re: [HttpClient] Problems with PUT and NTLM
> Matthew, > > I missed the fact that the server reported a 500 error, which
> indicates an internal server error rather than an authenticationerror.
> Still, the 'expect-continue' handshake may be worth a try > > If Slide exposes the underlying HTTP PUT method you can activate the > 'expect-continue' handshake by calling > > httpput.setUseExpectHeader(true); > > For details see > >
http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/ httpclient/methods/ExpectContinueMethod.html#setUseExpectHeader(boolean)
on> > You may also consider testing that HTTP PUT method using just plain > HttpClient with the wirelog turned on in order to get more details
Other> what is going on under the hood > > http://jakarta.apache.org/commons/httpclient/logging.html > > Hope this helps > > Oleg > > > On Fri, 2004-08-13 at 23:45, Matthew Beermann wrote: >> I'm trying to do a PUT with NTLM turned on, and it fails on a 500 >> error from the server, which in turn causes the console to report a >> "Unbuffered entity enclosing request can not be repeated" error.
showing>> commands though, like PROPFIND and MKCOL, go through the >> authentication steps and work perfectly. I've attached a log
handshake>> the client/server conversation. >> >> OlegK suggested that I should activate the expect-continue
not>> on the HttpClient, which might fix my problems, but I'm afraid I >> cannot figure out for the life of me how to do so. I should mention >> that I'm working with HttpClient through Slide, and as such, I'm
______________________________________________________________________>> interfacing with HttpClient directly. (Which is to say, the Slide >> library is creating PutMethod instances, not me.) >> >> --Matthew Beermann >> >>
>>---------------------------------------------------------------------
[EMAIL PROTECTED]>> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail:
> >
______________________________________________________________________ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
2004/08/16 15:33:43:556 CDT [DEBUG] HttpClient - -Java version: 1.4.2_05 2004/08/16 15:33:43:566 CDT [DEBUG] HttpClient - -Java vendor: Sun Microsystems Inc. 2004/08/16 15:33:43:566 CDT [DEBUG] HttpClient - -Java class path: C:\eclipse\workspace\ContentSync;C:\jakarta-slide-webdavclient-bin-2.1b1\lib\jakarta-slide-webdavlib-2.1b1.jar;C:\jakarta-slide-webdavclient-bin-2.1b1\lib\commons-httpclient.jar;C:\jakarta-slide-webdavclient-bin-2.1b1\lib\commons-logging.jar;C:\jakarta-slide-webdavclient-bin-2.1b1\lib\jdom-20040226-.jar 2004/08/16 15:33:43:576 CDT [DEBUG] HttpClient - -Operating system name: Windows XP 2004/08/16 15:33:43:576 CDT [DEBUG] HttpClient - -Operating system architecture: x86 2004/08/16 15:33:43:586 CDT [DEBUG] HttpClient - -Operating system version: 5.1 2004/08/16 15:33:44:335 CDT [DEBUG] HttpClient - -SUN 1.42: SUN (DSA key/parameter generation; DSA signing; SHA-1, MD5 digests; SecureRandom; X.509 certificates; JKS keystore; PKIX CertPathValidator; PKIX CertPathBuilder; LDAP, Collection CertStores) 2004/08/16 15:33:44:335 CDT [DEBUG] HttpClient - -SunJSSE 1.42: Sun JSSE provider(implements RSA Signatures, PKCS12, SunX509 key/trust factories, SSLv3, TLSv1) 2004/08/16 15:33:44:365 CDT [DEBUG] HttpClient - -SunRsaSign 1.42: SUN's provider for RSA signatures 2004/08/16 15:33:44:365 CDT [DEBUG] HttpClient - -SunJCE 1.42: SunJCE Provider (implements DES, Triple DES, AES, Blowfish, PBE, Diffie-Hellman, HMAC-MD5, HMAC-SHA1) 2004/08/16 15:33:44:365 CDT [DEBUG] HttpClient - -SunJGSS 1.0: Sun (Kerberos v5) 2004/08/16 15:34:19:458 CDT [DEBUG] HttpConnection - -HttpConnection.setSoTimeout(0) 2004/08/16 15:34:19:468 CDT [DEBUG] HttpMethodBase - -Execute loop try 1 2004/08/16 15:34:19:468 CDT [DEBUG] wire - ->> "PUT /moviesContent/action.html HTTP/1.1[\r][\n]" 2004/08/16 15:34:19:508 CDT [DEBUG] HttpMethodBase - -Adding Host request header 2004/08/16 15:34:19:518 CDT [DEBUG] wire - ->> "User-Agent: Jakarta Commons-HttpClient/2.0final[\r][\n]" 2004/08/16 15:34:19:518 CDT [DEBUG] wire - ->> "Host: XXX[\r][\n]" 2004/08/16 15:34:19:518 CDT [DEBUG] wire - ->> "Content-Length: 117773[\r][\n]" 2004/08/16 15:34:19:528 CDT [DEBUG] wire - ->> "Expect: 100-continue[\r][\n]" 2004/08/16 15:34:19:538 CDT [DEBUG] wire - ->> "[\r][\n]" 2004/08/16 15:34:19:538 CDT [DEBUG] HttpConnection - -HttpConnection.getSoTimeout() 2004/08/16 15:34:19:548 CDT [DEBUG] HttpConnection - -HttpConnection.setSoTimeout(3000) 2004/08/16 15:34:22:544 CDT [INFO] HttpMethodBase - -100 (continue) read timeout. Resume sending the request 2004/08/16 15:34:22:544 CDT [DEBUG] HttpConnection - -HttpConnection.setSoTimeout(0) 2004/08/16 15:34:22:544 CDT [DEBUG] EntityEnclosingMethod - -Using unbuffered request body 2004/08/16 15:34:22:824 CDT [DEBUG] EntityEnclosingMethod - -Request body sent 2004/08/16 15:34:22:874 CDT [DEBUG] wire - -<< "HTTP/1.1 401 Access Denied[\r][\n]" 2004/08/16 15:34:22:914 CDT [DEBUG] wire - -<< "Server: Microsoft-IIS/5.0[\r][\n]" 2004/08/16 15:34:22:914 CDT [DEBUG] wire - -<< "Date: Mon, 16 Aug 2004 20:34:28 GMT[\r][\n]" 2004/08/16 15:34:22:914 CDT [DEBUG] wire - -<< "WWW-Authenticate: Negotiate[\r][\n]" 2004/08/16 15:34:22:924 CDT [DEBUG] wire - -<< "WWW-Authenticate: NTLM[\r][\n]" 2004/08/16 15:34:22:924 CDT [DEBUG] wire - -<< "Connection: close[\r][\n]" 2004/08/16 15:34:22:924 CDT [DEBUG] wire - -<< "Content-Length: 4431[\r][\n]" 2004/08/16 15:34:22:924 CDT [DEBUG] wire - -<< "Content-Type: text/html[\r][\n]" 2004/08/16 15:34:22:924 CDT [DEBUG] HttpMethodBase - -Authorization required 2004/08/16 15:34:22:984 CDT [DEBUG] HttpAuthenticator - -Authenticating with the default authentication realm at XXX 2004/08/16 15:34:22:994 CDT [DEBUG] HttpMethodBase - -HttpMethodBase.execute(): Server demanded authentication credentials, will try again. 2004/08/16 15:34:22:994 CDT [DEBUG] HttpMethodBase - -Should close connection in response to Connection: close
2004/08/16 15:34:23:004 CDT [DEBUG] HttpMethodBase - -Execute loop try 2 2004/08/16 15:34:23:004 CDT [DEBUG] HttpMethodBase - -Opening the connection. 2004/08/16 15:34:23:024 CDT [DEBUG] wire - ->> "PUT /moviesContent/action.html HTTP/1.1[\r][\n]" 2004/08/16 15:34:23:024 CDT [DEBUG] HttpMethodBase - -Request to add Host header ignored: header already added 2004/08/16 15:34:23:024 CDT [DEBUG] wire - ->> "User-Agent: Jakarta Commons-HttpClient/2.0final[\r][\n]" 2004/08/16 15:34:23:034 CDT [DEBUG] wire - ->> "Host: XXX[\r][\n]" 2004/08/16 15:34:23:034 CDT [DEBUG] wire - ->> "Content-Length: 117773[\r][\n]" 2004/08/16 15:34:23:044 CDT [DEBUG] wire - ->> "Authorization: NTLM TlRMTVNTUAABAAAABlIAAAgACAAtAAAADQANACAAAABNQVRUIEJFRVJNQU5ORVhDSEFOR0U=[\r][\n]" 2004/08/16 15:34:23:044 CDT [DEBUG] wire - ->> "Expect: 100-continue[\r][\n]" 2004/08/16 15:34:23:054 CDT [DEBUG] wire - ->> "[\r][\n]" 2004/08/16 15:34:23:054 CDT [DEBUG] HttpConnection - -HttpConnection.getSoTimeout() 2004/08/16 15:34:23:054 CDT [DEBUG] HttpConnection - -HttpConnection.setSoTimeout(3000) 2004/08/16 15:34:26:061 CDT [INFO] HttpMethodBase - -100 (continue) read timeout. Resume sending the request 2004/08/16 15:34:26:061 CDT [DEBUG] HttpConnection - -HttpConnection.setSoTimeout(0) 2004/08/16 15:34:26:071 CDT [DEBUG] EntityEnclosingMethod - -Using unbuffered request body org.apache.commons.httpclient.HttpException: Unbuffered entity enclosing request can not be repeated.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
