On 03/03/15 21:35, Fabio Ricci wrote:
The point is that the jar jena-2.3.jar  (not jena 2.3 release 2005) is
in my lib folder because it contained the right database methods to be
used in persisting a model using DB. That is the reason why it is in the
package ... this was neede by my other try with the persisting ontology
model.

Anyway everything should/can be in memory ... so I will take it out :(
anyway the problem persists even without this jena-2.3.jar.

Just to be precise: in order to use the database functions a JAR
"jena.jar" is required.  In the jena package 2.12.1 of 2014 the JAR
"jena.jar" was missing and I could not figure out what jar should be
used ... The JAR  Jena-2.6.jar is not compatible neither... in
http://www.java2s.com/Code/Jar/j/Downloadjenajar.htm the latest JAR for
"jena.jar" is

Jena 2.6 is ancient.

Use the latest original versions from the Apache mirrors or use maven.

http://jena.apache.org/download/index.html


Jena seems to be still a long lasting puzzle for me ... nothing runs at
once ;)  ***perplex***

Anyway thank you for the hints.

Use all the jars in the distribution lib/ directory or, better, use the maven artifact

  <dependency>
    <groupId>org.apache.jena</groupId>
    <artifactId>apache-jena-libs</artifactId>
    <type>pom</type>
    <version>2.12.1</version>
  </dependency>

That includes TDB, the native database.

You can't pick and choose jars without risking missing a needed part. Picking up a few extra jars is no big deal while you get something working.

It still does not explain the error - that is due to multiple incompatible classes, I think.

        Andy


Bye

Am 3.3.15 um 22:14 schrieb Andy Seaborne:
On 03/03/15 20:20, Fabio Ricci wrote:
Dear all

and now I tried to use - following the documentation - TDB in order
to persist a data model.
I need to load and navigate an owl2 ontology in
http://webprotege.stanford.edu/#Edit:projectId=28f5a3a4-5896-42e8-8ea0-fe91aa7187a6


I am using he jars coming with   Jena-2-12-1   hence here
jena-tdb-1.1.1.jar together with jena-2.3.jar

Jena 2.3 was released 12 October 2005.  The chances of mixing that
with Jena 2.12.1 (October 2014) is very, very small.



According to the description in
https://jena.apache.org/documentation/tdb/java_api.html the commands
are:

// Make a TDB-backed dataset
          String braintumordir =
"/.../ONTOLOGIEN/brain_tumour_ontology-ontologies-owl-REVISION-1/" ;
 (*)     Dataset dataset = TDBFactory.createDataset(braintumordir) ;
          dataset.begin(ReadWrite.READ) ;
          Model model = dataset.getDefaultModel() ;

// Here the model should be used????
          dataset.end() ;

At (*) an exception is thrown:

SEVERE: StandardWrapper.Throwable
java.lang.IncompatibleClassChangeError: Implementing class
http://docs.oracle.com/javase/7/docs/api/java/lang/IncompatibleClassChangeError.html


Possibly the class path has multipl, incompatible versions of classed
on it.
hmmm.... I found that too with google ... but what will it be ...?

at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
    at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at
org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2452)
    at
org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:854)
    at
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1264)
    at
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1147)
    at
com.hp.hpl.jena.graph.NodeFactory.createLiteral(NodeFactory.java:81)
    at
com.hp.hpl.jena.sparql.graph.NodeConst.<clinit>(NodeConst.java:29)
    at
com.hp.hpl.jena.sparql.engine.optimizer.reorder.ReorderFixed.<clinit>(ReorderFixed.java:59)
    at
com.hp.hpl.jena.sparql.engine.optimizer.reorder.ReorderLib.fixed(ReorderLib.java:71)
    at com.hp.hpl.jena.tdb.sys.SystemTDB.<clinit>(SystemTDB.java:187)
    at com.hp.hpl.jena.tdb.TDB.<clinit>(TDB.java:90)
    at
com.hp.hpl.jena.tdb.setup.DatasetBuilderStd.<clinit>(DatasetBuilderStd.java:64)
    at
com.hp.hpl.jena.tdb.StoreConnection.make(StoreConnection.java:227)
    at
com.hp.hpl.jena.tdb.transaction.DatasetGraphTransaction.<init>(DatasetGraphTransaction.java:75)
    at com.hp.hpl.jena.tdb.sys.TDBMaker._create(TDBMaker.java:57)
    at
com.hp.hpl.jena.tdb.sys.TDBMaker.createDatasetGraphTransaction(TDBMaker.java:45)
    at
com.hp.hpl.jena.tdb.TDBFactory._createDatasetGraph(TDBFactory.java:104)
    at
com.hp.hpl.jena.tdb.TDBFactory.createDatasetGraph(TDBFactory.java:73)
    at com.hp.hpl.jena.tdb.TDBFactory.createDataset(TDBFactory.java:52)
    at com.hp.hpl.jena.tdb.TDBFactory.createDataset(TDBFactory.java:48)
    at com.semweb.semsearch.RDFNavigation.init(RDFNavigation.java:98)
    at
org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1241)
    at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1154)
    at
org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:827)
    at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:135)
    at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
    at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
    at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
    at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
    at
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
    at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
    at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:537)
    at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1085)
    at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:658)
    at
org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)
    at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1556)
    at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1513)
    at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:745)

And I have again no idea what to do ... in order to fix it.

My questions are:

1. How can I fix this error please ?

2. How can I instantiate an OntModel out of this model.

Thanks a lot in advance
Fabio












Reply via email to