hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ErwinZwart <er...@guruce.com>
Subject java.lang.NoSuchMethodError: org.apache.http.conn.scheme.Scheme.<init>
Date Tue, 08 Jan 2013 09:02:01 GMT
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...





--
View this message in context: http://httpcomponents.10934.n7.nabble.com/java-lang-NoSuchMethodError-org-apache-http-conn-scheme-Scheme-init-tp18698.html
Sent from the HttpClient-User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Mime
View raw message