title: The type org.apache.solr.client.solrj.SolrServerException cannot be resolved. It is indirectly referenced from required .class files
body: <p>I am calling a java class from a jsp page and the following exception: </p>
  
  <pre><code> org.apache.jasper.JasperException: Unable to compile class for JSP:
    An error occurred at line: 18 in the jsp file: /jsp_test.jsp
    The type org.apache.solr.client.solrj.SolrServerException cannot be resolved.
  </code></pre>
  
  <p>It is indirectly referenced from required .class files.</p>
  
  <pre><code> if(request.getParameter("query") != null)
   {
   solrj_api i=new solrj_api();
   i.index_xml();
   }
  
   %&gt;
  </code></pre>
  
  <p>solrj_api is the java class and index_xml is the method which I want to call.<br/>
  I have imported following :</p>
  
  <pre><code>import org.apache.solr.client.solrj.SolrQuery;
  import org.apache.solr.client.solrj.SolrServerException;
  import org.apache.solr.client.solrj.impl.HttpSolrServer;
  import org.apache.solr.client.solrj.impl.XMLResponseParser;
  import org.apache.solr.client.solrj.request.CoreAdminRequest;
  import org.apache.solr.client.solrj.response.CoreAdminResponse;
  import org.apache.solr.client.solrj.response.QueryResponse;
  import org.apache.solr.client.solrj.response.UpdateResponse;
  </code></pre>
  
  <p>when I run the program independently without a call from jsp it works fine.
  I have also included all the jars in the build path.</p>
  
  <p>Why do i get this exception?</p>