import can not be resolved error

2010-01-06 Thread Ajay Bansal
Hi friends, Today I was trying to use httpclient to generate some http requests. However, I am not able to go past the first step itself. I am getting errors for following classes : import org.apache.commons.httpclient.HttpClient; import

Re: import can not be resolved error

2010-01-06 Thread sebb
On 06/01/2010, Ajay Bansal ajay.bansa...@gmail.com wrote: Hi friends, Today I was trying to use httpclient to generate some http requests. However, I am not able to go past the first step itself. I am getting errors for following classes : import

Re: import can not be resolved error

2010-01-06 Thread Florent Blondeau
hi I think org.apache.httpcomponents.httpclient are the new packages from 4.0 version org.apache.commons.httpclient are the old ones for 3.x versions see the examples (and use IDE Autocompletion) to be sure ;-) Hope that helps florent Pingwy 27, rue des arènes 49100 Angers Ajay Bansal

Re: import can not be resolved error

2010-01-06 Thread Ajay Bansal
Not working. :( To be more specific : Here is my classpath (I am using eclipse) classpath classpathentry kind=src path=src/ classpathentry kind=con path=org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6/ classpathentry kind=con

Re: import can not be resolved error

2010-01-06 Thread Ajay Bansal
While I am trying to solve those import issues, I would like to execute following request using java code --header=X-P-Timestamp: 1262780093 --header=X-P-PAccessId: 3NJZKDY87A97 --header=X-PSignature: ClYCatFCVDV0= --header=Accept: application/xml http://localhost:8080/pri-api/demo/catalog;

Re: import can not be resolved error

2010-01-06 Thread Florent Blondeau
My mistake :-) org.apache.httpcomponents:httpclient may be the maven's artifact name I've just checked in my code : org.apache.http.client should work However if these imports are in a piece of code that used to work, it seems to be it have been designed to use HttpClient 3.x and not 4.x A

Re: import can not be resolved error

2010-01-06 Thread Ajay Bansal
True. I also discovered that :). I actually just used one the example files given on the site. On Wed, Jan 6, 2010 at 10:09 PM, Ken Krugler kkrugler_li...@transpac.comwrote: You're trying to use HttpClient 3.0 package names with the 4.0 jar. For example, my imports for using HttpClient 4.0

Re: Authentication fails in HttpClient but OK in browser

2010-01-06 Thread Ken Krugler
[trying again w/o code formatting, hopefully Apache mail server won't reject it as spam] Here's the code I use to set up for sending generic https GET requests. // Create and initialize scheme registry SchemeRegistry schemeRegistry = new SchemeRegistry();

Retry on ConnectTimeoutException

2010-01-06 Thread Olivier Lamy
Hi, I'm using http-client 4.0.1. Is there any way to use HttpRequestRetryHandler to handle retry on ConnectTimeoutException ? (I did it with http client 3 ) Thanks, -- Olivier - To unsubscribe, e-mail:

Re: Retry on ConnectTimeoutException

2010-01-06 Thread Khosro Asgharifard
Hi all, Olivier , Maybe i could not answer your question but i have one question . Sometimes i got the Read timeout orConnection reset orStream close exceptions . and Read timeout exception is the most one. How do you use HttpRequestRetryHandler to handle Read timeout exception ? I

Re: Retry on ConnectTimeoutException

2010-01-06 Thread Olivier Lamy
Thanks for reply. Yes I already use this for this type of exception. But this doesn't catch the ConnectionTimeOut. -- Olivier 2010/1/6 Khosro Asgharifard khosro_quest...@yahoo.com: Hi all, Olivier , Maybe i could not answer your question but i have one question . Sometimes i got the Read

Re: Retry on ConnectTimeoutException

2010-01-06 Thread Ken Krugler
From my experience, you get a ConnectTimeoutException when you've made a configuration or implementation mistake. E.g. - your connection pool size isn't big enough given the number of simultaneous threaded requests. - you're not releasing connections properly (e.g. when aborting a request)

Re: Retry on ConnectTimeoutException

2010-01-06 Thread Olivier Lamy
NO. ConnectionTimeOutException can means the target endPoint cannot be contacted. My software POST some datas to various systems : company ones and externals one. Sometimes some systems are on small maintenance mode or during a restart time or some other stuffs. What I like is to not failed

Re: Retry on ConnectTimeoutException

2010-01-06 Thread Olivier Lamy
Sure. It's just I found this more elegant/readable code using the retry handler mechanism rather than writing catch/loop as with http client 3.x. -- Olivier 2010/1/6 Ken Krugler kkrugler_li...@transpac.com: On Jan 6, 2010, at 12:49pm, Olivier Lamy wrote: NO. ConnectionTimeOutException can

Re: Java Version Compatiblity

2010-01-06 Thread Oleg Kalnichevski
Luke Pillow wrote: Hello, I'd like to use the HTTPClient, but I'm restricted to Java 1.4.2. Is 3.1 compatible with Java 1.4.2? HttpClient 3.x requires Java 1.2.2 Is 4.x compatible with Java 1.4.2? HttpClient 4.x requires Java 1.5.0. However, HttpCore - a set of low level transport

Re: Retry on ConnectTimeoutException

2010-01-06 Thread Oleg Kalnichevski
Olivier Lamy wrote: Sure. It's just I found this more elegant/readable code using the retry handler mechanism rather than writing catch/loop as with http client 3.x. While I agree with Ken that retrying requests on ConnectTimeoutException feels wrong, it is certainly incorrect that retry