atom feed1 message in org.apache.hc.httpclient-usersjava.lang.NoSuchMethodError: org.apac...
FromSent OnAttachments
ErwinZwartJan 8, 2013 1:02 am 
Subject:java.lang.NoSuchMethodError: org.apache.http.conn.scheme.Scheme.<init>
From:ErwinZwart (erw@guruce.com)
Date:Jan 8, 2013 1:02:01 am
List:org.apache.hc.httpclient-users

First of all my environment:

Android application using Eclipse httpclient-4.2.2.jar

This is my piece of intelligent code:

public class TestPCCManagerActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main);

// SchemeRegistry reg = new SchemeRegistry(); // Scheme sch = new Scheme("http", 80, PlainSocketFactory.getSocketFactory());

PoolingClientConnectionManager cm = new PoolingClientConnectionManager();

} }

All builds fine.

When running the application I got into the Fatal exception telling me that org.apache.http.conn.scheme.Scheme.<init> method is not found.

Further investigation seems that there the problem is when a new Scheme object is created. So I added the code (commented out in the example above) which is used inside the PoolingClientConnectionManager class:

SchemeRegistry reg = new SchemeRegistry(); Scheme sch = new Scheme("http", 80, PlainSocketFactory.getSocketFactory());

I am getting an compile error telling me:

<http://httpcomponents.10934.n7.nabble.com/file/n18698/error.png>

Searchiing the documentation it seems that this constructor is used for library 4.2.2. However the error tels met that it expects: new Scheme("http", PlainSocketFactory.getSocketFactory(). 80); but this is, again according to the documentation, 4.1 and is deprecated.

documentation taken from: http://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/conn/scheme/Scheme.html

<http://httpcomponents.10934.n7.nabble.com/file/n18698/scheme.png>

I have absolutely no idea. I also rebuilded the httpclient source code cause the code seems ok, but that did not help,

What am I missing here help...