Hi Mickael,

Usually when this happens, its because at sometime previously, the store has been accessed non-transactionally and the JVM exits without the application calling sync().

Best is to use dataset transactions, working with the dataset, and getting the default model inside a database transaction.

Guessing from the name "SessionJenaTDB", this can fit well, with the pattern of incoming request, "get database", do something, end request.

You may be able to recover by deleting the prefix indexes. Not ideal and not guaranteed to work.

        Andy

On 29/10/15 15:21, Mickaël BARON wrote:
Hi,

I have a strange behaviour on JenaTDB when i'm executing a SPARQL query
more one time.

The first execution is ok, but from the second one i have this exception

Exception in thread "main" java.lang.NullPointerException
   at
com.hp.hpl.jena.tdb.store.DatasetPrefixesTDB.readPrefixMap(DatasetPrefixesTDB.java:174)
   at
com.hp.hpl.jena.sparql.graph.GraphPrefixesProjection.getNsPrefixMap(GraphPrefixesProjection.java:62)
   at
com.hp.hpl.jena.tdb.store.DatasetPrefixesTDB.getPrefixMapping(DatasetPrefixesTDB.java:223)
   at
com.hp.hpl.jena.tdb.store.DatasetPrefixesTDB.getPrefixMapping(DatasetPrefixesTDB.java:214)
   at
com.hp.hpl.jena.tdb.store.GraphTDB.createPrefixMapping(GraphTDB.java:78)
   at
com.hp.hpl.jena.graph.impl.GraphBase.getPrefixMapping(GraphBase.java:186)
   at
com.hp.hpl.jena.rdf.model.impl.ModelCom.getPrefixMapping(ModelCom.java:980)
   at
com.hp.hpl.jena.rdf.model.impl.ModelCom.withDefaultMappings(ModelCom.java:1024)
   at com.hp.hpl.jena.rdf.model.impl.ModelCom.<init>(ModelCom.java:74)
   at com.hp.hpl.jena.rdf.model.impl.ModelCom.<init>(ModelCom.java:70)
   at
com.hp.hpl.jena.rdf.model.ModelFactory.createModelForGraph(ModelFactory.java:176)
   at
com.hp.hpl.jena.sparql.core.DatasetImpl.graph2model(DatasetImpl.java:271)
   at
com.hp.hpl.jena.sparql.core.DatasetImpl.getDefaultModel(DatasetImpl.java:103)
   at
fr.ensma.lias.qarscore.connection.implementation.JenaSession.set_model(JenaSession.java:187)
   at
fr.ensma.lias.qarscore.connection.implementation.SessionJenaTDB.<init>(SessionJenaTDB.java:56)
   at
fr.ensma.lias.qarscore.connection.implementation.SessionJenaTDB.getSessionTDB(SessionJenaTDB.java:45)
   at
fr.ensma.lias.qarscore.connection.SessionFactory.getTDBSession(SessionFactory.java:73)
   at fr.ensma.lias.qarscore.Test.<init>(Test.java:33)
   at fr.ensma.lias.qarscore.Test.main(Test.java:59)

The JenaTDB repository after the first execution was changed. Two file have
been impacted: prefix2id.dat prefixIdx.dat

Curiously, this problem was occurred on both Linux and MAC operating system
not on Windows OS platform.

Do you have an idea about this problem ?

Thanks

Mickael


Reply via email to