title: NoClassDefFoundError when trying to run a sparql query for Dbpedia in java. (org/slf4j/LoggerFactor)
body: <p>My objective for this program is to run a Sparql query via java and obtain the respective results in the Console.</p>
  
  <p>If i am not wrong, the error is because of a missing jar file. However, in my opinion the required jar files have been added. 
  I have added the following jar files : <code>Jena-2.1.jar</code> and <code>arq-2.8.7.jar</code>.</p>
  
  <p>My code is as follows:</p>
  
  <pre><code>public class Example {
  
  public static void main(String[] args) {
  
  
      //http request
      String website = "http://dbpedia.org/sparql";
  
      //whatever query we want to parse.
      String query =  "SELECT ?abstract WHERE { { &lt;http://dbpedia.org/resource/Ronaldo&gt; &lt;http://dbpedia.org/ontology/abstract&gt; ?abstract } }";                
  
      //query execution using the library object.
      QueryExecution queryEx = QueryExecutionFactory.sparqlService(website, query);
  
  
      try {
          //results coming from the executed queries.
          ResultSet results = queryEx.execSelect();
  
          //prints the output.
          for(; results.hasNext();){
              //typecast results from set to qsolution
              QuerySolution answer = (QuerySolution)results.next();
  
              System.out.println(answer.get("?abstract"));            
  
          }
      } catch(Exception e){
  
          e.printStackTrace();
      } finally{
          queryEx.close();
      }
  }
  </code></pre>
  
  <p>and the image of the error i am receiving is:</p>
  
  <pre><code>&lt;pre&gt;Exception in thread "main" java.lang.NoSuchMethodError: com.hp.hpl.jena.iri.IRIFactory.jenaImplementation()Lcom/hp/hpl/jena/iri/IRIFactory;
  at com.hp.hpl.jena.n3.IRIResolver.&lt;clinit&gt;(IRIResolver.java:42)
  at com.hp.hpl.jena.sparql.mgt.SystemInfo.createIRI(SystemInfo.java:31)
  at com.hp.hpl.jena.sparql.mgt.SystemInfo.&lt;init&gt;(SystemInfo.java:23)
  at com.hp.hpl.jena.query.ARQ.init(ARQ.java:373)
  at com.hp.hpl.jena.query.ARQ.&lt;clinit&gt;(ARQ.java:385)
  at com.hp.hpl.jena.query.Query.&lt;clinit&gt;(Query.java:53)
  at com.hp.hpl.jena.query.QueryFactory.create(QueryFactory.java:68)
  at com.hp.hpl.jena.query.QueryFactory.create(QueryFactory.java:40)
  at com.hp.hpl.jena.query.QueryFactory.create(QueryFactory.java:28)
  at com.hp.hpl.jena.query.QueryExecutionFactory.sparqlService(QueryExecutionFactory.java:338)
  at Example.main(Example.java:27)&lt;code&gt;
  </code></pre>
  
  <p>Any guidance will be appreciated. Thanks in advance.</p>