>java.net.ConnectException: Connection refused
>  at
>org.apache.solr.client.solrj.
>impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:391)

The "Connection refused" error is caused becaused that the servers have been
stopped.

I>Are you sure both servers are running properly? You can hit them
> individually?

I start both servers and if I comment out "query.setParam("shards",
"localhost:8983/solr, localhost:7574/solr");  " or
"query.setSortField("id",SolrQuery.ORDER.asc);", it will both
work correctly.

However, if I keep them both in the program, I got the error as follows:

  org.apache.solr.client.solrj.SolrServerException: Error executing query
    at
org.apache.solr.client.solrj.request.QueryRequest.process(QueryRequest.java:103)
    at org.apache.solr.client.solrj.SolrServer.query(SolrServer.java:115)
    at test.MainClassTest.searchTest(MainClassTest.java:88)
    at test.MainClassTest.main(MainClassTest.java:48)

Reply via email to