user1319054
user1319054

Reputation: 41

java HttpClient-4.1.2 jar

i am using httpclient-4.1.2 jar file in my project,and write code:

HttpClient client = new DefaultHttpClient();

but its throwing an exception

Exception in thread "main" java.lang.VerifyError: (class: org/apache/http/impl/client/DefaultHttpClient, method: setDefaultHttpParams signature: (Lorg/apache/http/params/HttpParams;)V) Incompatible argument to function

Upvotes: 0

Views: 1998

Answers (2)

Anuj Balan
Anuj Balan

Reputation: 7729

The parameter "HttpParams" is in fact an interface which needs to be sent as parameter to setDefaultHttpParams.

Are you constructing this and is it being sent? In order to send it, you need to have some other jar, and this is the problem.

Upvotes: 1

Angelo Fuchs
Angelo Fuchs

Reputation: 9941

You have to have the other jars for the httpclient as well (httpcore for example, a lots of the apache commons as well).

Upvotes: 1

Related Questions