Will do. - Erich
On Mon, May 16, 2022 at 3:43 PM Andy Seaborne <[email protected]> wrote:
> Hi - could you raise an issue for this please.
>
> There's a backlog at th emoment so don't want to loose it.
>
> Andy
>
> PS the difference is that there are newlines in the
> con.query(Query) form and not in the con.query(String) form - add a \nb
> and I expect it will also break.
>
> On 16/05/2022 17:47, Erich Bremer wrote:
> > I changed
> > QueryExecution qe = con.query(query);
> > to
> > QueryExecution qe = con.query("select ?s where {?s ?p ?o} limit 10");
> > and it works. A bug in the former method? - Erich
> >
> > On Mon, May 16, 2022 at 12:31 PM Erich Bremer <[email protected]> wrote:
> >
> >> Thanks Andy, this is a huge help.
> >> using this code:
> >>
> >> Query query = QueryFactory.create("select ?s where {?s ?p ?o} limit
> 10");
> >> AuthEnv.get().registerUsernamePassword(new URI("
> >> https://myserver.edu/sparql-auth"), Settings.user, Settings.password);
> >> HttpClient client = HttpClient.newBuilder()
> >> .connectTimeout(Duration.ofSeconds(10))
> >> .version(HttpClient.Version.HTTP_1_1)
> >> .build();
> >> RDFConnection con = RDFConnectionRemote.create()
> >> .destination(host)
> >> .queryEndpoint("sparql-auth")
> >> .httpClient(client)
> >> .build();
> >> QueryExecution qe = con.query(query);
> >> ResultSet results = qe.execSelect();
> >>
> >> is throwing an error:
> >>
> >> Exception in thread "main" java.lang.IllegalArgumentException: invalid
> >> header value: "Digest username="username", realm="SPARQL",
> >> nonce="b7ef0b701772c22b88db561ac58bd55f",
> uri="/sparql-auth?query=SELECT ?s
> >> WHERE
> >> { ?s ?p ?o }
> >> LIMIT 10
> >> ", qop=auth, cnonce="D8DA17AFEAD93444", nc=00000000,
> >> response="4d8ba8cef8aaa7f22d1adf811c6ac903",
> >> opaque="5ebe2294ecd0e0f08eab7690d2a6ee69""
> >> at
> java.net.http/jdk.internal.net.http.common.Utils.newIAE(Utils.java:286)
> >> at
> >>
> java.net.http/jdk.internal.net.http.HttpRequestBuilderImpl.checkNameAndValue(HttpRequestBuilderImpl.java:113)
> >> at
> >>
> java.net.http/jdk.internal.net.http.HttpRequestBuilderImpl.setHeader(HttpRequestBuilderImpl.java:119)
> >> at
> >>
> java.net.http/jdk.internal.net.http.HttpRequestBuilderImpl.setHeader(HttpRequestBuilderImpl.java:43)
> >> at
> >>
> org.apache.jena.http.auth.DigestLib.lambda$buildDigest$0(DigestLib.java:119)
> >> at org.apache.jena.http.auth.AuthLib.handle401(AuthLib.java:124)
> >> at org.apache.jena.http.auth.AuthLib.authExecute(AuthLib.java:54)
> >> at org.apache.jena.http.HttpLib.execute(HttpLib.java:536)
> >> at org.apache.jena.http.HttpLib.execute(HttpLib.java:493)
> >> at
> >>
> org.apache.jena.sparql.exec.http.QueryExecHTTP.executeQuery(QueryExecHTTP.java:497)
> >> at
> >>
> org.apache.jena.sparql.exec.http.QueryExecHTTP.performQuery(QueryExecHTTP.java:471)
> >> at
> >>
> org.apache.jena.sparql.exec.http.QueryExecHTTP.execRowSet(QueryExecHTTP.java:168)
> >> at
> >>
> org.apache.jena.sparql.exec.http.QueryExecHTTP.select(QueryExecHTTP.java:160)
> >> at
> >>
> org.apache.jena.sparql.exec.QueryExecutionAdapter.execSelect(QueryExecutionAdapter.java:117)
> >> at
> >>
> org.apache.jena.sparql.exec.QueryExecutionCompat.execSelect(QueryExecutionCompat.java:97)
> >> at com.mycompany.rad.RDF.<init>(RDF.java:90)
> >> at com.mycompany.rad.RDF.main(RDF.java:105)
> >>
> >> I'm using Graalvm:
> >> java -version
> >> openjdk version "17.0.3" 2022-04-19
> >> OpenJDK Runtime Environment GraalVM CE 22.1.0 (build
> >> 17.0.3+7-jvmci-22.1-b06)
> >> OpenJDK 64-Bit Server VM GraalVM CE 22.1.0 (build
> 17.0.3+7-jvmci-22.1-b06,
> >> mixed mode, sharing)
> >>
> >> - Erich
> >>
> >> On Mon, May 16, 2022 at 11:49 AM Andy Seaborne <[email protected]> wrote:
> >>
> >>>
> >>>
> >>> On 16/05/2022 16:11, Erich Bremer wrote:
> >>>> It seems in Jena 4.3.X forward HttpClient in
> RDFConnectionRemoteBuilder
> >>> was
> >>>> changed from org.apache.http.client.HttpClient to
> >>> java.net.http.HttpClient.
> >>>> The latter doesn't appear to support Digest Authentication. Is there
> >>>> support for Digest authentication in 4.3.X forward? I was able to do
> it
> >>>> with the older RDFConnectionRemoteBuilder. Thanks, Erich
> >>>>
> >>>
> >>> https://jena.apache.org/documentation/sparql-apis/
> >>>
> >>> Digest auth is supported (implemented by Jena).
> >>>
> >>> Andy
> >>>
> >>
> >
>