clerezza-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Minto van der Sluis <mi...@xup.nl>
Subject Re: ERROR: Quad: object cannot be null
Date Fri, 12 Jul 2013 20:48:12 GMT
Fixed this with commit r1502677 (CLEREZZA-802)

Please have a close look. Might need to be part of the pending release
as well.

Regards,

Minto

Op 12-7-2013 18:14, Minto van der Sluis schreef:
> This time I end up with an NPE, see stack below.
>
> My changes resulted in the following
>
>     public Object executeSparqlQuery(String query, TripleCollection
> defaultGraph, boolean forceFastlane) throws ParseException {
>         TcProvider singleTargetTcProvider = null;
>         if (forceFastlane) {
>             singleTargetTcProvider = getSingleTargetTcProvider();
>         } else {       
>             final UriRef defaultGraphName = new
> UriRef("urn:x-temp:/kjsfadfhfasdffds");
>             SparqlPreParser sparqlPreParser = new SparqlPreParser(this);
>             final Set<UriRef> referencedGraphs =
> sparqlPreParser.getReferredGraphs(query, defaultGraphName);
>             if ((referencedGraphs != null) &&
> (!referencedGraphs.contains(defaultGraphName))) {
>                 singleTargetTcProvider =
> getSingleTargetTcProvider(referencedGraphs);
>             }
>         }
>        
>         if ((singleTargetTcProvider != null) && (singleTargetTcProvider
> instanceof QueryableTcProvider)) {
>             return
> ((QueryableTcProvider)singleTargetTcProvider).executeSparqlQuery(query,
> null);
>         }
>         final QueryEngine queryEngine = this.queryEngine;
>         if (queryEngine != null) {
>             return queryEngine.execute(this, defaultGraph, query);
>         } else {
>             throw new NoQueryEngineException();
>         }
>     }
>
>    private TcProvider getSingleTargetTcProvider() {
>         return providerList.first();
>     }
>
> I guess the following like in BaseTdbTcProvider.executeSparqlQuery() is
> the culprit:
>
>        getDataset().setDefaultModel(null);
>
> Stacktrace:
>
> java.lang.NullPointerException
>     at
> com.hp.hpl.jena.sparql.core.DatasetImpl.addToCache(DatasetImpl.java:259)
>     at
> com.hp.hpl.jena.sparql.core.DatasetImpl.setDefaultModel(DatasetImpl.java:214)
>     at
> org.apache.clerezza.rdf.jena.tdb.storage.BaseTdbTcProvider.executeSparqlQuery(BaseTdbTcProvider.java:39)
>     at
> org.apache.clerezza.rdf.jena.tdb.storage.ScalableSingleTdbDatasetTcProvider.executeSparqlQuery(ScalableSingleTdbDatasetTcProvider.java:81)
>     at
> org.apache.clerezza.rdf.core.access.TcManager.executeSparqlQuery(TcManager.java:310)
>     at
> org.apache.clerezza.rdf.core.access.TcManager.executeSparqlQuery(TcManager.java:282)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)[:1.7.0_17]
>     at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_17]
>     at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_17]
>     at java.lang.reflect.Method.invoke(Method.java:601)[:1.7.0_17]
>     at
> org.apache.aries.proxy.impl.ProxyHandler$1.invoke(ProxyHandler.java:54)[12:org.apache.aries.proxy.impl:1.0.0]
>     at
> org.apache.aries.proxy.impl.ProxyHandler.invoke(ProxyHandler.java:119)[12:org.apache.aries.proxy.impl:1.0.0]
>     at
> org.apache.clerezza.rdf.core.access.$TcManager10360330.executeSparqlQuery(Unknown
> Source)[181:org.apache.clerezza.rdf.core:0.13.0.SNAPSHOT]
>     at
> nl.overheid.stelsel.digimelding.astore.storage.clerezza.ClerezzaStorageProvider.query(ClerezzaStorageProvider.java:250)[209:astore-storage-clerezza:0.7.0.SNAPSHOT]
>


-- 
ir. ing. Minto van der Sluis
Software innovator / renovator
Xup BV

Mobiel: +31 (0) 626 014541


Mime
View raw message