|
From: Bryan T. <br...@sy...> - 2015-07-25 07:02:52
|
Without knowing the contents of the following class, it is very difficult
to know what is happening. It looks like the Journal has been closed or
shutdown.
at com.blippar.blazegraph.BlazegraphUtils.executeSelectQuery(
BlazegraphUtils.java:62)
If you use the BigdataSail(Properties) constructor then it "owns" the
backing Journal object and will close it when the BigdataSail is shutdown.
The NSS uses the alternative constructor in order to have the Journal
remain open. I suggest you look at the QueryServlet and
BigdataRDFServletContextListener
to see how this is managed (your own use case might be much simpler).
public BigdataSail(final AbstractTripleStore database) {
Thanks,
Bryan
----
Bryan Thompson
Chief Scientist & Founder
SYSTAP, LLC
4501 Tower Road
Greensboro, NC 27410
br...@sy...
http://blazegraph.com
http://blog.bigdata.com <http://bigdata.com>
http://mapgraph.io
Blazegraph™ <http://www.blazegraph.com/> is our ultra high-performance
graph database that supports both RDF/SPARQL and Tinkerpop/Blueprints
APIs. MapGraph™ <http://www.systap.com/mapgraph> is our disruptive new
technology to use GPUs to accelerate data-parallel graph analytics.
<http://smartdata2015.dataversity.net/>
CONFIDENTIALITY NOTICE: This email and its contents and attachments are
for the sole use of the intended recipient(s) and are confidential or
proprietary to SYSTAP. Any unauthorized review, use, disclosure,
dissemination or copying of this email or its contents or attachments is
prohibited. If you have received this communication in error, please notify
the sender by reply email and permanently delete all copies of the email
and its contents and attachments.
On Fri, Jul 24, 2015 at 3:22 PM, Joakim Soderberg <
joa...@bl...> wrote:
> Hi,
> I am running a Sparql query using the sample code;
>
> DataManager dm = DataManager.getInstance();
> Repository repo = dm.getRepository();
> try {
>
>
> if( repo.isInitialized()) LOG.info("Repo is initialized!");
> else {
> repo.initialize();
> LOG.info("Initialized repo");
> }
> TupleQueryResult result = BlazegraphUtils.executeSelectQuery(repo, query,
> QueryLanguage.SPARQL, false);
>
> -----
>
> public static TupleQueryResult executeSelectQuery(Repository repo, String
> query, QueryLanguage ql, boolean IncludeInferred) throws Exception {
>
>
> RepositoryConnection cxn;
> TupleQueryResult result = null;
> if (repo instanceof BigdataSailRepository) {
> cxn = ((BigdataSailRepository) repo).getReadOnlyConnection();
> } else {
> cxn = repo.getConnection();
> }
>
>
> try {
>
> final TupleQuery tupleQuery = cxn.prepareTupleQuery(ql, query
> );
> if(IncludeInferred) tupleQuery.setIncludeInferred(
> IncludeInferred /* includeInferred */);
> result = tupleQuery.evaluate();
>
>
> } finally {
> // close the repository connection
> cxn.close();
> log.info("closed connection");
> }
> return result;
> }
>
>
> and the second time it’s executed I get this error message. For some
> reason the second time
>
> cxn = ((BigdataSailRepository) repo).getReadOnlyConnection();
>
> is called, it triggers the problem.
>
> java.lang.IllegalStateException: Service not available
> 2015-07-24 11:47:27,679 INFO [QueryAction.java:90] : Shut down repo
> DataService is done!
> at com.bigdata.service.AbstractTransactionService.newTx(
> AbstractTransactionService.java:733)
> at com.bigdata.journal.Journal$InnerJournalTransactionService._newTx(
> Journal.java:2315)
> at com.bigdata.journal.Journal$InnerJournalTransactionService.newTx(
> Journal.java:2158)
> at com.bigdata.rdf.sail.BigdataSail$BigdataSailReadOnlyConnection.newTx(
> BigdataSail.java:4697)
> at com.bigdata.rdf.sail.BigdataSail$BigdataSailReadOnlyConnection.<init>(
> BigdataSail.java:4636)
> at com.bigdata.rdf.sail.BigdataSail._getReadOnlyConnection(
> BigdataSail.java:1597)
> at com.bigdata.rdf.sail.BigdataSail.getReadOnlyConnection(
> BigdataSail.java:1571)
> at com.bigdata.rdf.sail.BigdataSail.getReadOnlyConnection(
> BigdataSail.java:1553)
> at com.bigdata.rdf.sail.BigdataSailRepository.getReadOnlyConnection(
> BigdataSailRepository.java:123)
> at com.blippar.blazegraph.BlazegraphUtils.executeSelectQuery(
> BlazegraphUtils.java:62)
> at com.blippar.action.QueryAction.execute(QueryAction.java:60)
> at com.blippar.servlet.MinervaServlet.doPost(MinervaServlet.java:87)
> at com.blippar.servlet.MinervaServlet.doGet(MinervaServlet.java:54)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:291)
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(
> ApplicationFilterChain.java:206)
> at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:239)
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(
> ApplicationFilterChain.java:206)
> at org.apache.catalina.core.StandardWrapperValve.invoke(
> StandardWrapperValve.java:219)
> at org.apache.catalina.core.StandardContextValve.invoke(
> StandardContextValve.java:106)
> at org.apache.catalina.authenticator.AuthenticatorBase.invoke(
> AuthenticatorBase.java:502)
> 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:617)
> at org.apache.catalina.core.StandardEngineValve.invoke(
> StandardEngineValve.java:88)
> at org.apache.catalina.connector.CoyoteAdapter.service(
> CoyoteAdapter.java:518)
> at org.apache.coyote.http11.AbstractHttp11Processor.process(
> AbstractHttp11Processor.java:1091)
> at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(
> AbstractProtocol.java:668)
> at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(
> NioEndpoint.java:1527)
> at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(
> NioEndpoint.java:1484)
> 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)
>
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Bigdata-developers mailing list
> Big...@li...
> https://lists.sourceforge.net/lists/listinfo/bigdata-developers
>
>
|