Hello,

The method objects used in sentences like " int code = client.executeMethod(method) " are method classes from slide 2.0 library. For Example:

org.apache.webdav.lib.methods.MoveMethod;
org.apache.webdav.lib.methods.PropPatchMethod;
org.apache.webdav.lib.methods.SearchMethod;
org.apache.webdav.lib.methods.DeleteMethod;

All of them are returning the same error.

Did you hear before about any problem caused by using http-client3.0 and slide together ?

We also tried with the last release candidate of slide and it didn't work.

thanks, once more.

Oleg Kalnichevski escribi�:

On Wed, Jun 15, 2005 at 11:04:38AM +0200, Rafael Puig Herrador wrote:
Hi again Oleg,

how long without talk to you ...   :)

The latest nigthly build doesnt work, I'm getting the same error ...


I suspect something is broken in your code.

I'll change the question ...
How can I get the Content-Length header form the object method?

Any class derived from EntityEnclosingMethod will automatically inherit
this ability.


is there any method in the method API to get this? -> object method could be DeleteMethod, SearchMethod, PropPatch, ... I dont find anthing related to this ...

There are no such methods in the standard HttpClient distributions.

I repeat again, the problem is in that to execute the executeMethod(..) its necessary generate the Content-Length header in the request. If this header is not sended, the server response is 411 (Length Required), so I need to create this header before I send the Http request.


My theory at this point is that something is broken in the layer that
sits on top of HttpClient, the one that implements SearchMethod and the
likes.
This is all I can do for you at the moment

Oleg

thanks a lot ...
bye.


Oleg Kalnichevski escribi?:

Rafael,



2005/06/14 19:00:49:703 CEST [DEBUG] header - ->> "SEARCH /exchange/emilio HTTP/1.1[\r][\n]"
First off, you have subclassed one of the standard HTTP methods.
HttpClient 3.0 is not meant to be entirely backward compatible, drop-in
replacement for HttpClient 2.0. You have to make sure that your code
does not use any deprecated methods

Secondly, your code is likely to have been affected by this bug, which
is going to be included in the coming 3.0 RC3 release:

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

Meanwhile consider trying the latest nightly build and see if that makes
any difference

http://svn.apache.org/builds/jakarta-commons/nightly/commons-httpclient/

Hope this helps

Oleg


On Tue, 2005-06-14 at 19:11 +0200, Rafael Puig Herrador wrote:


Hi, once more ...

I get this log:

2005/06/14 19:00:49:687 CEST [DEBUG] HttpConnection - -Open connection to 10.2.30.74:80 2005/06/14 19:00:49:703 CEST [DEBUG] header - ->> "SEARCH /exchange/emilio HTTP/1.1[\r][\n]" 2005/06/14 19:00:49:703 CEST [DEBUG] HttpMethodBase - -Adding Host request header
2005/06/14 19:00:49:718 CEST [DEBUG] header - ->> "Keep-Alive: 0[\r][\n]"
2005/06/14 19:00:49:718 CEST [DEBUG] header - ->> "Content-Type: text/xml; charset=utf-8[\r][\n]" 2005/06/14 19:00:49:718 CEST [DEBUG] header - ->> "User-Agent: Jakarta Commons-HttpClient/3.0-rc2[\r][\n]" 2005/06/14 19:00:49:718 CEST [DEBUG] header - ->> "Host: 10.2.30.74[\r][\n]"
2005/06/14 19:00:49:718 CEST [DEBUG] header - ->> "[\r][\n]"
2005/06/14 19:00:49:734 CEST [DEBUG] header - -<< "HTTP/1.1 401 Unauthorized[\r][\n]" 2005/06/14 19:00:49:734 CEST [DEBUG] header - -<< "Content-Length: 83[\r][\n]" 2005/06/14 19:00:49:734 CEST [DEBUG] header - -<< "Content-Type: text/html[\r][\n]" 2005/06/14 19:00:49:734 CEST [DEBUG] header - -<< "Server: Microsoft-IIS/6.0[\r][\n]" 2005/06/14 19:00:49:734 CEST [DEBUG] header - -<< "WWW-Authenticate: Negotiate[\r][\n]" 2005/06/14 19:00:49:734 CEST [DEBUG] header - -<< "WWW-Authenticate: NTLM[\r][\n]" 2005/06/14 19:00:49:734 CEST [DEBUG] header - -<< "WWW-Authenticate: Basic realm="10.2.30.74"[\r][\n]" 2005/06/14 19:00:49:734 CEST [DEBUG] header - -<< "MicrosoftOfficeWebServer: 5.0_Pub[\r][\n]" 2005/06/14 19:00:49:734 CEST [DEBUG] header - -<< "X-Powered-By: ASP.NET[\r][\n]" 2005/06/14 19:00:49:734 CEST [DEBUG] header - -<< "Date: Tue, 14 Jun 2005 17:01:18 GMT[\r][\n]" 2005/06/14 19:00:49:734 CEST [DEBUG] HttpMethodBase - -Resorting to protocol version default close connection policy 2005/06/14 19:00:49:734 CEST [DEBUG] HttpMethodBase - -Should NOT close connection, using HTTP/1.1 2005/06/14 19:00:49:734 CEST [DEBUG] HttpConnection - -Connection is locked. Call to releaseConnection() ignored. 2005/06/14 19:00:49:734 CEST [DEBUG] HttpMethodDirector - -Authorization required 2005/06/14 19:00:49:765 CEST [DEBUG] AuthChallengeProcessor - -Supported authentication schemes in the order of preference: [ntlm, digest, basic] 2005/06/14 19:00:49:765 CEST [INFO] AuthChallengeProcessor - -ntlm authentication scheme selected 2005/06/14 19:00:49:765 CEST [DEBUG] AuthChallengeProcessor - -Using authentication scheme: ntlm 2005/06/14 19:00:49:765 CEST [DEBUG] AuthChallengeProcessor - -Authorization challenge processed 2005/06/14 19:00:49:765 CEST [DEBUG] HttpMethodDirector - -Authentication scope: NTLM <any realm>@10.2.30.74:80 2005/06/14 19:00:49:765 CEST [DEBUG] HttpMethodDirector - -Retry authentication 2005/06/14 19:00:49:765 CEST [DEBUG] HttpMethodDirector - -Authenticating with NTLM <any realm>@10.2.30.74:80 2005/06/14 19:00:49:765 CEST [DEBUG] HttpMethodParams - -Credential charset not configured, using HTTP element charset 2005/06/14 19:00:49:781 CEST [DEBUG] header - ->> "SEARCH /exchange/emilio HTTP/1.1[\r][\n]" 2005/06/14 19:00:49:781 CEST [DEBUG] HttpMethodBase - -Adding Host request header
2005/06/14 19:00:49:781 CEST [DEBUG] header - ->> "Keep-Alive: 0[\r][\n]"
2005/06/14 19:00:49:781 CEST [DEBUG] header - ->> "Content-Type: text/xml; charset=utf-8[\r][\n]" 2005/06/14 19:00:49:781 CEST [DEBUG] header - ->> "User-Agent: Jakarta Commons-HttpClient/3.0-rc2[\r][\n]" 2005/06/14 19:00:49:781 CEST [DEBUG] header - ->> "Authorization: NTLM TlRMTVNTUAABAAAABlIAAAoACgAqAAAACgAKACAAAAAxMC4yLjMwLjc0MTAuMi4zMC43NA==[\r][\n]" 2005/06/14 19:00:49:781 CEST [DEBUG] header - ->> "Host: 10.2.30.74[\r][\n]"
2005/06/14 19:00:49:781 CEST [DEBUG] header - ->> "[\r][\n]"
2005/06/14 19:00:49:781 CEST [DEBUG] header - -<< "HTTP/1.1 401 Unauthorized[\r][\n]" 2005/06/14 19:00:49:796 CEST [DEBUG] header - -<< "Content-Length: 83[\r][\n]" 2005/06/14 19:00:49:796 CEST [DEBUG] header - -<< "Content-Type: text/html[\r][\n]" 2005/06/14 19:00:49:796 CEST [DEBUG] header - -<< "Server: Microsoft-IIS/6.0[\r][\n]" 2005/06/14 19:00:49:796 CEST [DEBUG] header - -<< "WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADgAAAAGAoECnwqn9rSmK+cAAAAAAAAAAKYApgBAAAAABQLODgAAAA9QQU5EQVBSRQIAEABQAEEATgBEAEEAUABSAEUAAQAUAEUAUwBQAFIARQBFAFgASAAwADIABAAcAHAAYQBuAGQAYQBwAHIAZQAuAGwAbwBjAGEAbAADADIAZQBzAHAAcgBlAGUAeABoADAAMgAuAHAAYQBuAGQAYQBwAHIAZQAuAGwAbwBjAGEAbAAFABwAcABhAG4AZABhAHAAcgBlAC4AbABvAGMAYQBsAAAAAAA=[\r][\n]" 2005/06/14 19:00:49:796 CEST [DEBUG] header - -<< "MicrosoftOfficeWebServer: 5.0_Pub[\r][\n]" 2005/06/14 19:00:49:796 CEST [DEBUG] header - -<< "X-Powered-By: ASP.NET[\r][\n]" 2005/06/14 19:00:49:796 CEST [DEBUG] header - -<< "Date: Tue, 14 Jun 2005 17:01:18 GMT[\r][\n]" 2005/06/14 19:00:49:796 CEST [DEBUG] HttpMethodBase - -Resorting to protocol version default close connection policy 2005/06/14 19:00:49:796 CEST [DEBUG] HttpMethodBase - -Should NOT close connection, using HTTP/1.1 2005/06/14 19:00:49:796 CEST [DEBUG] HttpConnection - -Connection is locked. Call to releaseConnection() ignored. 2005/06/14 19:00:49:796 CEST [DEBUG] HttpMethodDirector - -Authorization required 2005/06/14 19:00:49:796 CEST [DEBUG] AuthChallengeProcessor - -Using authentication scheme: ntlm 2005/06/14 19:00:49:796 CEST [DEBUG] AuthChallengeProcessor - -Authorization challenge processed 2005/06/14 19:00:49:796 CEST [DEBUG] HttpMethodDirector - -Authentication scope: NTLM <any realm>@10.2.30.74:80 2005/06/14 19:00:49:796 CEST [DEBUG] HttpMethodDirector - -Retry authentication 2005/06/14 19:00:49:796 CEST [DEBUG] HttpMethodDirector - -Authenticating with NTLM <any realm>@10.2.30.74:80 2005/06/14 19:00:49:796 CEST [DEBUG] HttpMethodParams - -Credential charset not configured, using HTTP element charset 2005/06/14 19:00:50:859 CEST [DEBUG] header - ->> "SEARCH /exchange/emilio HTTP/1.1[\r][\n]" 2005/06/14 19:00:50:859 CEST [DEBUG] HttpMethodBase - -Adding Host request header
2005/06/14 19:00:50:859 CEST [DEBUG] header - ->> "Keep-Alive: 0[\r][\n]"
2005/06/14 19:00:50:859 CEST [DEBUG] header - ->> "Content-Type: text/xml; charset=utf-8[\r][\n]" 2005/06/14 19:00:50:859 CEST [DEBUG] header - ->> "User-Agent: Jakarta Commons-HttpClient/3.0-rc2[\r][\n]" 2005/06/14 19:00:50:859 CEST [DEBUG] header - ->> "Authorization: NTLM TlRMTVNTUAADAAAAGAAYAFoAAAAAAAAAcgAAAAoACgBAAAAABgAGAEoAAAAKAAoAUAAAAAAAAAByAAAABlIAADEwLjIuMzAuNzRFTUlMSU8xMC4yLjMwLjc0u2eDOyr6tkxIA+fjNb7JtkNGVfWPHjdE[\r][\n]" 2005/06/14 19:00:50:859 CEST [DEBUG] header - ->> "Host: 10.2.30.74[\r][\n]"
2005/06/14 19:00:50:875 CEST [DEBUG] header - ->> "[\r][\n]"
2005/06/14 19:00:50:875 CEST [DEBUG] header - -<< "HTTP/1.1 411 Length Required[\r][\n]" 2005/06/14 19:00:50:875 CEST [DEBUG] header - -<< "Connection: close[\r][\n]" 2005/06/14 19:00:50:875 CEST [DEBUG] header - -<< "Date: Tue, 14 Jun 2005 17:01:19 GMT[\r][\n]" 2005/06/14 19:00:50:875 CEST [DEBUG] header - -<< "Server: Microsoft-IIS/6.0[\r][\n]" 2005/06/14 19:00:50:875 CEST [DEBUG] header - -<< "MicrosoftOfficeWebServer: 5.0_Pub[\r][\n]" 2005/06/14 19:00:50:875 CEST [DEBUG] header - -<< "X-Powered-By: ASP.NET[\r][\n]" 2005/06/14 19:00:50:875 CEST [DEBUG] header - -<< "Content-Type: text/html[\r][\n]" 2005/06/14 19:00:50:875 CEST [DEBUG] header - -<< "Content-Length: 147[\r][\n]" 2005/06/14 19:00:50:875 CEST [DEBUG] HttpMethodBase - -Should close connection in response to directive: close 2005/06/14 19:00:50:875 CEST [DEBUG] HttpConnection - -Connection is locked. Call to releaseConnection() ignored. 2005/06/14 19:00:50:875 CEST [DEBUG] HttpConnection - -Releasing connection back to connection manager.

I'll wait for your answers ...
bye, see you tomorrow ....


Oleg Kalnichevski escribi?:

All right. Once again

(1) Have you upgraded to 3.0 RC2 to start with?
(2) Have you followed the instructions of the logging guide, especially
this one: "Note: The system properties must be set before a reference to
any Commons Logging class is made."? Alternatively set these system
properties at the JRE startup time java -Dorg.apache.commons.logging.Log=... and so on

Oleg


On Tue, Jun 14, 2005 at 06:28:07PM +0200, Rafael Puig Herrador wrote:


Hi again,

doing that way, i get this message:

2005/06/14 18:17:40:984 CEST [DEBUG] httpclient - [EMAIL PROTECTED]

It give me no information ... This way I dont know whats happening, why am I getting code 411 after execute "executeMethod(method)" ?
I had not this problem with version 2 of  http-client ...

Thanks for answering so quickly,

bye

PS: excuse me if my English isnt very good ...

Oleg Kalnichevski escribi?:



On Tue, Jun 14, 2005 at 05:26:38PM +0200, Rafael Puig Herrador wrote:


Hello Oleg,

I dont understand this: 'post the wire/context log of the HTTP session that exhibits the problem'



Rafael,

By the HTTP session I meant all the HTTP messages sent and received by
HttpClient that are logically related



I have read the logging guide but I dont know what to do, can you help me, please?
How can I show the log of the HTTP Session?
I do this:

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.header", "debug"); System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.commons.httpclient", "debug");
SimpleLog sl = new SimpleLog("org.apache.commons.httpclient");

sl.debug(client); // ?????
int code=client.executeMethod (method);
...

is it OK?, any suggestion?


This should be okay.

Oleg




greetings and thanks

PS: I have upgraded to the version3 RC2 but I have the same problem ...

Oleg Kalnichevski escribi?:



Rafael,

Please follow the instructions of this guide and post the wire/context
log of the HTTP session that exhibits the problem:

http://jakarta.apache.org/commons/httpclient/3.0/logging.html

Oleg
PS: Please also consider upgrading to the latest 3.0 release, which is
3.0 RC2

On Tue, Jun 14, 2005 at 01:37:00PM +0200, Rafael Puig Herrador wrote:




Hi,

using http-client version 2 I had no problem when executing the /executeMethod(method)/ method. This generated all request headers (including Content-Length), but now, using version 3 RC1 I get from this method the code 411 (Length Required), it does not generate the Content-Length header.

Does anyone know what the problem is?

Thanks

---------------------------------------------------------------------
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]







---------------------------------------------------------------------
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]





---------------------------------------------------------------------
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]





---------------------------------------------------------------------
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]





---------------------------------------------------------------------
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]




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

Reply via email to