簡體   English   中英

為什么在Virtuoso檢查點出現“找不到404文件”(通過耶拿)?

[英]Why do I get `404 File not found` (through Jena) during Virtuoso checkpoint?

我們有一個名為Virtuoso的Java應用程序。 如果它在Virtuoso做一個檢查點時運行某些SPARQL查詢,它將給出: "com.hp.hpl.jena.sparql.engine.http.QueryExceptionHTTP: File not found"

我的第一個念頭是因為CheckpointSyncMode=2 ,它阻止了查詢。 但是當CheckpointSyncMode=1時,我設法獲得了此異常。

不幸的是,我不能復制比方法調用更多的代碼。 但我可以使用任何SPARQL查詢來重現它。

ResponseResult resultsAndBindings = APIEndpointUtil.call(req, nb, match, contextPath, queryParams);

這是堆棧跟蹤:

HttpException: 404 File not found
at com.hp.hpl.jena.sparql.engine.http.HttpQuery.execCommon(HttpQuery.java:446)
at com.hp.hpl.jena.sparql.engine.http.HttpQuery.execPost(HttpQuery.java:344)
at com.hp.hpl.jena.sparql.engine.http.HttpQuery.exec(HttpQuery.java:239)
at com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP.execSelect(QueryEngineHTTP.java:302)
at com.epimorphics.lda.sources.SourceBase.executeSelect(SourceBase.java:110)
at com.epimorphics.lda.query.APIQuery.requestTotalCount(APIQuery.java:917)
at com.epimorphics.lda.core.APIEndpointImpl.call_revised(APIEndpointImpl.java:112)
at com.epimorphics.lda.core.APIEndpointImpl.call(APIEndpointImpl.java:92)
at com.epimorphics.lda.core.APIEndpointUtil.call(APIEndpointUtil.java:53)

在非常簡單的測試環境中重做:

我設置了一個空的Virtuoso實例:

OpenLink Virtuoso Server
Version 07.20.3215-pthreads for Linux as of Jan 20 2016"

CheckpointSyncMode=2CheckpointSyncMode=1無關緊要; 無論如何都會發生。

確保Virtuoso忙於檢查點:

#!/bin/bash

while true; do
    isql-vt 1111 dba dba exec="checkpoint;"
done;

使用Jena調用端點(使用: com.epimorphics.lda:elda-lda:1.3.16com.epimorphics.lda:elda-lda:1.3.16jena-core:2.10.1 ):

import com.hp.hpl.jena.query.ParameterizedSparqlString;
import com.hp.hpl.jena.query.QueryExecution;
import com.hp.hpl.jena.query.QueryExecutionFactory;
import com.hp.hpl.jena.query.QuerySolution;

public class Main {

    public static void main(String args[]){

        while(true)
            getPreviousSnapshot();
    }

    public static void getPreviousSnapshot() {

        ParameterizedSparqlString pss = new ParameterizedSparqlString("SELECT DISTINCT ?g WHERE {  GRAPH ?g {    ?s ?p ?o  }}");

        System.out.println("Executing SPARQL query:" + pss.toString());

        QueryExecution qe = QueryExecutionFactory.sparqlService("http://33.33.33.11:8890/sparql", pss.asQuery());
        com.hp.hpl.jena.query.ResultSet resultSet = qe.execSelect();

        processResultSet(resultSet);
        qe.close();

    }

    private static void processResultSet(com.hp.hpl.jena.query.ResultSet results) {

        while (results.hasNext()) {
            QuerySolution qs = results.next();
            String s = qs.getResource("g").toString();
            System.out.println(s);

        }
    }
}

輸出:

Executing SPARQL query:SELECT DISTINCT ?g WHERE {  GRAPH ?g {    ?s ?p ?o  }}
http://www.openlinksw.com/schemas/virtrdf#
http://www.w3.org/ns/ldp#
http://localhost:8890/sparql
http://localhost:8890/DAV/
http://www.w3.org/2002/07/owl#
Executing SPARQL query:SELECT DISTINCT ?g WHERE {  GRAPH ?g {    ?s ?p ?o  }}
Exception in thread "main" HttpException: 404 File not found
    at com.hp.hpl.jena.sparql.engine.http.HttpQuery.execCommon(HttpQuery.java:446)
    at com.hp.hpl.jena.sparql.engine.http.HttpQuery.execGet(HttpQuery.java:289)
    at com.hp.hpl.jena.sparql.engine.http.HttpQuery.exec(HttpQuery.java:240)
    at com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP.execSelect(QueryEngineHTTP.java:302)
    at Main.getPreviousSnapshot(Main.java:21)
    at Main.main(Main.java:11)

根據我在virtuoso郵件列表上得到的答案:Jena在Virtuoso由於執行檢查點而暫時無法訪問時,無法連接到SPARQL服務(這在Virtuoso中是原子動作),因此僅返回404錯誤。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM