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 lot of refactoring has been made in this version's transition (an amazing work by Oleg...) that makes 3.x code and 4.x binary incompatible

Check that before trying to use the 4.0 jar

cheers

Florent

Pingwy
27, rue des arènes
49100 Angers



Ajay Bansal a écrit :
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" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
<classpathentry kind="lib"
path="lib/httpcomponents-client-4.0.1/lib/apache-mime4j-0.6.jar"/>
 <classpathentry kind="lib"
path="lib/httpcomponents-client-4.0.1/lib/commons-codec-1.3.jar"/>
<classpathentry kind="lib"
path="lib/httpcomponents-client-4.0.1/lib/commons-logging-1.1.1.jar"/>
 <classpathentry kind="lib"
path="lib/httpcomponents-client-4.0.1/lib/httpclient-4.0.1.jar"/>
<classpathentry kind="lib"
path="lib/httpcomponents-client-4.0.1/lib/httpcore-4.0.1.jar"/>
 <classpathentry kind="lib"
path="lib/httpcomponents-client-4.0.1/lib/httpmime-4.0.1.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>


It says not found for following imports :

import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.FileRequestEntity;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.methods.RequestEntity;

=========================


Also, as suggested by Florent, org.apache.httpcomponents.httpclient is also
not working.


-Ajay


On Wed, Jan 6, 2010 at 6:58 PM, Florent Blondeau <[email protected]>wrote:

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 a écrit :

 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 org.apache.commons.httpclient.methods.FileRequestEntity;

import org.apache.commons.httpclient.methods.PostMethod;

import org.apache.commons.httpclient.methods.RequestEntity;



It says : can not be resolved.

I have following jar files in my classpath



httpclient-4.0.1.jar


Am I missing some other jar file for above mentioned packages?


Thanks

-Ajay








Reply via email to