2

Any idea what I am missing ?

Error in HttpClient Web Service with SSL class. HTTPClient Connection Problem , when connecting with SSL Client --- Added Imports are:--

 import android.app.Activity;
 import android.net.ConnectivityManager;
 import android.net.NetworkInfo;
 import com.gns.socialtongits.net.ssl.SSLClient;
 import com.gns.socialtongits.util.Log;
 import org.apache.http.HttpResponse;
 import org.apache.http.client.ClientProtocolException;
 import org.apache.http.client.HttpClient;
 import org.apache.http.client.entity.UrlEncodedFormEntity;
 import org.apache.http.client.methods.HttpGet;
 import org.apache.http.client.methods.HttpPost;
 import org.apache.http.entity.StringEntity;
 import org.apache.http.message.BasicNameValuePair;
 import org.apache.http.params.BasicHttpParams;
 import org.apache.http.params.HttpConnectionParams;
 import org.apache.http.params.HttpParams;
 import java.io.IOException;
 import java.net.URLEncoder;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;


 // And Class Methods are:-
public class SSLClient extends DefaultHttpClient {

    public SSLClient(HttpParams hparms) {
        super(hparms);
    }

    @Override
    protected ClientConnectionManager createClientConnectionManager() {
        SchemeRegistry registry = new SchemeRegistry();
        registry.register(new Scheme("http", PlainSocketFactory
                .getSocketFactory(), 80));

        // Register for port 443 our SSLSocketFactory with our keystore
        // to the ConnectionManager
        registry.register(new Scheme("https", new EasySSLSocketFactory(), 443));

        // http://blog.synyx.de/2010/06/android-and-self-signed-ssl-certificates/
        return new SingleClientConnManager(getParams(), registry);
    }
}

Error message that received, after running the project --

Process: com.gns.socialtongits.pro.android, PID: 8487
java.lang.NoClassDefFoundError: com.gns.socialtongits.net.ssl.SSLClient
at com.gns.socialtongits.net.HttpUtil.get(HttpUtil.java:162)
at com.gns.socialtongits.net.WebServiceHelperImpl.getConfiguration(WebServiceHelperImpl.java:36)
at com.gns.socialtongits.android.SocialTongitsApps$2.run(SocialTongitsApps.java:310)
at java.lang.Thread.run(Thread.java:841)
pankaj
  • 21
  • 4
  • Seems like you have added a custom library com.gns.socialtongits.net.ssl.SSLClient. Can you check the build path and the order of import for your libraries if they are included? – Techidiot Sep 14 '15 at 10:29
  • basically i am using android studio not eclipse. thats why i have used path like this, in gradle file. but problem not solved. Thanks for reply. – pankaj Sep 14 '15 at 10:38
  • Still you need to do that. Check this http://stackoverflow.com/questions/8678630/noclassdeffounderror-for-code-in-an-java-library-on-android – Techidiot Sep 14 '15 at 10:39

0 Answers0