Uploaded image for project: 'Apache Jena'
  1. Apache Jena
  2. JENA-2257

QueryExecHTTP#actualSendMode ignores query length causing HTTP 414

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Jena 4.3.2
    • Jena 4.4.0
    • ARQ, SPARQL
    • None

    Description

      QueryExecHTTP#actualSendMode(), called in QueryExecHTTP#query(String reqAcceptHeader), does not consider the length of the query. In case of long queries, this causes 414 Request-URI Too Long errors, even if sendMode==QuerySendMode.asGetWithLimitBody (default):

      HttpException: 414 Request-URI Too Long
          at org.apache.jena.sparql.engine.http.QueryExceptionHTTP.rewrap(QueryExceptionHTTP.java:49)
          at org.apache.jena.sparql.exec.http.QueryExecHTTP.executeQuery(QueryExecHTTP.java:493)
          at org.apache.jena.sparql.exec.http.QueryExecHTTP.query(QueryExecHTTP.java:483)
          at org.apache.jena.sparql.exec.http.QueryExecHTTP.execRdfWorker(QueryExecHTTP.java:339)
          at org.apache.jena.sparql.exec.http.QueryExecHTTP.execGraph(QueryExecHTTP.java:287)
          at org.apache.jena.sparql.exec.http.QueryExecHTTP.construct(QueryExecHTTP.java:244)
          at org.apache.jena.sparql.exec.QueryExecutionAdapter.execConstruct(QueryExecutionAdapter.java:129)

      Workarounds:

      • QuerySendMode.systemDefault = QuerySendMode.asPost;
      • QueryExecution.service(…).sendMode(QuerySendMode.asPost)

      Attachments

        Issue Links

          Activity

            People

              andy Andy Seaborne
              jmkeil Jan Martin Keil
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: