Hello, I'm struggling to retreive some data from my localhost Solr from an
Android Application. but i'm still having the same error.

/05-06 18:22:09.036: E/AndroidRuntime(1628): java.lang.NoSuchMethodError:
org.apache.http.conn.scheme.Scheme.<init>
05-06 18:22:09.036: E/AndroidRuntime(1628):     at
org.apache.http.impl.conn.SchemeRegistryFactory.createSystemDefault(SchemeRegistryFactory.java:83)
05-06 18:22:09.036: E/AndroidRuntime(1628):     at
org.apache.http.impl.client.SystemDefaultHttpClient.createClientConnectionManager(SystemDefaultHttpClient.java:121)
05-06 18:22:09.036: E/AndroidRuntime(1628):     at
org.apache.http.impl.client.AbstractHttpClient.getConnectionManager(AbstractHttpClient.java:221)/

I'm using these Jars : 
- Commons-io-2.1.jar
- httpclient-4.3.1.jar
- httpcore-4.3.jar
- jcl-over-slf4j-1.6.6.jar
- jul-to-slf4j-1.6.6.jar
- log4j-1.2.16.jar
- slf4j-api-1.6.6.jar
- slf4j-log4j12-1.6.6.jar
- solr-solrj-4.8.0jar


and this is the code I wrote :
/package com.example.secondapp;

import java.net.MalformedURLException;

import org.apache.solr.client.solrj.SolrQuery;
import org.apache.solr.client.solrj.SolrServer;
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.impl.HttpSolrServer;
import org.apache.solr.client.solrj.response.QueryResponse;
import org.apache.solr.common.SolrDocumentList;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class MainActivity extends Activity {

        Button btn1;
        EditText etxt1;
        
        public void RunIt() throws MalformedURLException, SolrServerException 
        {
                String urlString = "http://localhost:8983/solr/collection1";;
        
        SolrServer solr = new HttpSolrServer(urlString);
                
        SolrQuery parameters = new SolrQuery();
        
        parameters.set("qt", "/select");
                parameters.set("q", "mem");
                
                QueryResponse response = solr.query(parameters);
                SolrDocumentList list = response.getResults();
                
                
                   // for (int i = 0; i < list.size(); ++i) {
                    
                     // etxt1.setText((CharSequence) list.get(i));
                    //}
                
        }
        
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
        btn1=(Button)findViewById(R.id.button1);
        etxt1=(EditText)findViewById(R.id.editText1);
        
        
        btn1.setOnClickListener(new View.OnClickListener() {
                        
                        @Override
                        public void onClick(View v) {
                                
                                
                                etxt1.setText("a fin111");
                                
                                
                                try {
                                        RunIt();
                                } catch (MalformedURLException e) {
                                        // TODO Auto-generated catch block
                                        e.printStackTrace();
                                } catch (SolrServerException e) {
                                        // TODO Auto-generated catch block
                                        e.printStackTrace();
                                }
                                
                                
                        }
                });
            }
}/


can anyone tell me the mistake
thanks.




--
View this message in context: 
http://lucene.472066.n3.nabble.com/Solrj-problem-tp4135030.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to