helloo i have configured solr on tomcat 7 in windows so when i
manually start tomcat server and when i hit the solr it searches very well
in my browser .
and when i write a java class with main method as follows the results are
fetched and shown on console.
public class Code{
public static void main(String[] args) throws MalformedURLException,
SolrServerException {
SolrServer solr = new CommonsHttpSolrServer("http://192.168.16.221:8080/solr
");
ModifiableSolrParams params = new ModifiableSolrParams();
params.set("q", "subhash");
System.out.println("response = " + params);
QueryResponse response = solr.query(params);
System.out.println("response = " + response);
}
}
But when i use the same code in method and call this method using its
object this error is shown
java.lang.NoClassDefFoundError:
org/apache/solr/client/solrj/SolrServerException
Eagerly waiting for your reply.