2 Replies Latest reply: Aug 8, 2011 1:42 PM by 880207 RSS

    Arq Jar version problem while running Sparql Queries

    880207
      Hi,

      Here I am using jena-2.6.4.jar and arq-2.8.7.jar(bundled with Jena2.6.4).
      Also i am using jena adapter for Oracle DB 11g Release 2.
      Same Code works perfectly fine returning the results when i use arq-2.8.5.jar in my classpath instead of arq-2.8.7.jar,rest all jars are same.

      Jars in my classpath-

      xercesImpl-2.7.1.jar
      icu4j-3.4.4.jar
      iri-0.8.jar
      junit-4.5.jar
      log4j-1.2.13.jar
      lucene-core-2.3.1.jar
      slf4j-api-1.5.8.jar
      slf4j-log4j12-1.5.8.jar
      stax-api-1.0.1.jar
      wstx-asl-3.2.9.jar
      ojdbc5.jar
      sdordf.jar
      sdordfclient.jar
      jena-2.6.4.jar
      arq-2.8.7.jar

      Execution Code :

      String queryString =
                
           
                "SELECT ?associate1 ?associate2 WHERE {?associate1 <http://www..../supervisorOf> ?associate2 .} ";
           
           
           Query query = QueryFactory.create(queryString);
           QueryExecution qexec = QueryExecutionFactory.create(query, model);
           
           ResultSet results = qexec.execSelect();
                
           ResultSetFormatter.out(System.out, results, query);



      Below is the error i get,

      Exception in thread "main" java.lang.NoClassDefFoundError: com/hp/hpl/jena/sparql/algebra/opt/Rewrite
           at java.lang.ClassLoader.defineClass1(Native Method)
           at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
           at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
           at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
           at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
           at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
           at java.security.AccessController.doPrivileged(Native Method)
           at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
           at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
           at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
           at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
           at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
           at oracle.spatial.rdf.client.jena.QueryEngineSem.modifyOp(QueryEngineSem.java:179)
           at com.hp.hpl.jena.sparql.engine.QueryEngineBase.createPlan(QueryEngineBase.java:104)
           at com.hp.hpl.jena.sparql.engine.QueryEngineBase.getPlan(QueryEngineBase.java:97)
           at oracle.spatial.rdf.client.jena.QueryEngineSem$1.create(QueryEngineSem.java:202)
           at com.hp.hpl.jena.sparql.engine.QueryExecutionBase.getPlan(QueryExecutionBase.java:266)
           at com.hp.hpl.jena.sparql.engine.QueryExecutionBase.startQueryIterator(QueryExecutionBase.java:243)
           at com.hp.hpl.jena.sparql.engine.QueryExecutionBase.execResultSet(QueryExecutionBase.java:248)
           at com.hp.hpl.jena.sparql.engine.QueryExecutionBase.execSelect(QueryExecutionBase.java:94)
           at JenaSparqlSelect.main(JenaSparqlSelect.java:88)
      Caused by: java.lang.ClassNotFoundException: com.hp.hpl.jena.sparql.algebra.opt.Rewrite
           at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
           at java.security.AccessController.doPrivileged(Native Method)
           at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
           at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
           at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
           at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
           at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
           ... 21 more

      Any advise on this will be of great help.

      Thanks & Regards
      Manish H

      Edited by: 877204 on Aug 8, 2011 1:04 AM