Apache HTTPclient 4 を使用して、SPARQL クエリをリモート リポジトリに送信しています。プログラムは同じですが、JAR パッケージが受け取る応答は HTTP 406 で、エラー メッセージは「受け入れ可能なファイル形式が見つかりません」です。日食中に、私のクエリは成功し、HTTP 200 応答と目的の結果を受け取りました。
同じコードを持つ 2 つの環境の動作が異なる原因は何ですか?
日食メッセージ: (HTTP 200)
19:32:23.584 [main] DEBUG o.a.c.h.MultiThreadedHttpConnectionManager - HttpConnectionManager.getConnection: config = HostConfiguration[host=http://asimov.ludat.lth.se], timeout = 0
19:32:23.585 [main] DEBUG o.a.c.h.MultiThreadedHttpConnectionManager - Allocating new connection, hostConfig=HostConfiguration[host=http://asimov.ludat.lth.se]
19:32:23.585 [main] DEBUG o.a.c.httpclient.HttpConnection - Open connection to asimov.ludat.lth.se:80
19:32:23.589 [main] DEBUG httpclient.wire.header - >> "POST /openrdf-sesame/repositories/KnowRob HTTP/1.1[\r][\n]"
19:32:23.590 [main] DEBUG o.a.c.httpclient.HttpMethodBase - Adding Host request header
19:32:23.593 [main] DEBUG httpclient.wire.header - >> "Content-Type: application/x-www-form-urlencoded; charset=utf-8[\r][\n]"
19:32:23.594 [main] DEBUG httpclient.wire.header - >> "Accept: application/x-binary-rdf-results-table[\r][\n]"
19:32:23.594 [main] DEBUG httpclient.wire.header - >> "Accept: application/sparql-results+xml;q=0.8[\r][\n]"
19:32:23.595 [main] DEBUG httpclient.wire.header - >> "Accept: application/xml;q=0.8[\r][\n]"
19:32:23.596 [main] DEBUG httpclient.wire.header - >> "Accept: text/tab-separated-values;q=0.8[\r][\n]"
19:32:23.596 [main] DEBUG httpclient.wire.header - >> "Accept: text/csv;q=0.8[\r][\n]"
19:32:23.597 [main] DEBUG httpclient.wire.header - >> "User-Agent: Jakarta Commons-HttpClient/3.1[\r][\n]"
19:32:23.597 [main] DEBUG httpclient.wire.header - >> "Host: asimov.ludat.lth.se[\r][\n]"
19:32:23.598 [main] DEBUG httpclient.wire.header - >> "Content-Length: 836[\r][\n]"
19:32:23.598 [main] DEBUG httpclient.wire.header - >> "[\r][\n]"
19:32:23.599 [main] DEBUG httpclient.wire.content - >> "quer[...]rue"
19:32:23.600 [main] DEBUG o.a.c.h.m.EntityEnclosingMethod - Request body sent
19:32:24.304 [main] DEBUG httpclient.wire.header - << "HTTP/1.1 200 OK[\r][\n]"
19:32:24.304 [main] DEBUG httpclient.wire.header - << "HTTP/1.1 200 OK[\r][\n]"
19:32:24.305 [main] DEBUG httpclient.wire.header - << "Server: Apache-Coyote/1.1[\r][\n]"
19:32:24.305 [main] DEBUG httpclient.wire.header - << "Vary: Accept[\r][\n]"
19:32:24.306 [main] DEBUG httpclient.wire.header - << "Content-Disposition: attachment; filename=query-result.brt[\r][\n]"
19:32:24.306 [main] DEBUG httpclient.wire.header - << "Content-Type: application/x-binary-rdf-results-table;charset=ISO-8859-1[\r][\n]"
19:32:24.306 [main] DEBUG httpclient.wire.header - << "Content-Language: en-US[\r][\n]"
19:32:24.307 [main] DEBUG httpclient.wire.header - << "Transfer-Encoding: chunked[\r][\n]"
19:32:24.307 [main] DEBUG httpclient.wire.header - << "Date: Thu, 28 Feb 2013 18:28:24 GMT[\r][\n]"
19:32:24.307 [main] DEBUG httpclient.wire.header - << "[\r][\n]"
19:32:24.308 [main] DEBUG org.openrdf.http.client.HTTPClient - reponse MIME type is application/x-binary-rdf-results-table
JAR メッセージ: (HTTP 406)
19:15:35.178 [main] DEBUG o.a.c.h.MultiThreadedHttpConnectionManager - HttpConnectionManager.getConnection: config = HostConfiguration[host=http://asimov.ludat.lth.se], timeout = 0
19:15:35.179 [main] DEBUG o.a.c.h.MultiThreadedHttpConnectionManager - Allocating new connection, hostConfig=HostConfiguration[host=http://asimov.ludat.lth.se]
19:15:35.179 [main] DEBUG o.a.c.httpclient.HttpConnection - Open connection to asimov.ludat.lth.se:80
19:15:35.183 [main] DEBUG httpclient.wire.header - >> "POST /openrdf-sesame/repositories/KnowRob HTTP/1.1[\r][\n]"
19:15:35.184 [main] DEBUG o.a.c.httpclient.HttpMethodBase - Adding Host request header
19:15:35.187 [main] DEBUG httpclient.wire.header - >> "Content-Type: application/x-www-form-urlencoded; charset=utf-8[\r][\n]"
19:15:35.188 [main] DEBUG httpclient.wire.header - >> "Accept: text/tab-separated-values;q=0.8[\r][\n]"
19:15:35.188 [main] DEBUG httpclient.wire.header - >> "Accept: text/csv;q=0.8[\r][\n]"
19:15:35.189 [main] DEBUG httpclient.wire.header - >> "User-Agent: Jakarta Commons-HttpClient/3.1[\r][\n]"
19:15:35.189 [main] DEBUG httpclient.wire.header - >> "Host: asimov.ludat.lth.se[\r][\n]"
19:15:35.189 [main] DEBUG httpclient.wire.header - >> "Content-Length: 836[\r][\n]"
19:15:35.190 [main] DEBUG httpclient.wire.header - >> "[\r][\n]"
19:15:35.191 [main] DEBUG httpclient.wire.content - >> "query[...]er=true"
19:15:35.191 [main] DEBUG o.a.c.h.m.EntityEnclosingMethod - Request body sent
19:15:35.717 [main] DEBUG httpclient.wire.header - << "HTTP/1.1 406 Not Acceptable[\r][\n]"
19:15:35.717 [main] DEBUG httpclient.wire.header - << "HTTP/1.1 406 Not Acceptable[\r][\n]"
19:15:35.718 [main] DEBUG httpclient.wire.header - << "Server: Apache-Coyote/1.1[\r][\n]"
19:15:35.718 [main] DEBUG httpclient.wire.header - << "Vary: Accept[\r][\n]"
19:15:35.718 [main] DEBUG httpclient.wire.header - << "Content-Type: text/plain;charset=UTF-8[\r][\n]"
19:15:35.719 [main] DEBUG httpclient.wire.header - << "Content-Language: en-US[\r][\n]"
19:15:35.719 [main] DEBUG httpclient.wire.header - << "Content-Length: 32[\r][\n]"
19:15:35.719 [main] DEBUG httpclient.wire.header - << "Date: Thu, 28 Feb 2013 18:11:35 GMT[\r][\n]"
19:15:35.720 [main] DEBUG httpclient.wire.header - << "[\r][\n]"
19:15:35.720 [main] DEBUG o.a.c.httpclient.HttpMethodBase - Buffering response body
19:15:35.720 [main] DEBUG httpclient.wire.content - << "No acceptable file format found."
19:15:35.721 [main] DEBUG o.a.c.httpclient.HttpMethodBase - Resorting to protocol version default close connection policy
19:15:35.721 [main] DEBUG o.a.c.httpclient.HttpMethodBase - Should NOT close connection, using HTTP/1.1
19:15:35.721 [main] DEBUG o.a.c.httpclient.HttpConnection - Releasing connection back to connection manager.
19:15:35.721 [main] DEBUG o.a.c.h.MultiThreadedHttpConnectionManager - Freeing connection, hostConfig=HostConfiguration[host=http://asimov.ludat.lth.se]
19:15:35.722 [main] DEBUG o.a.c.h.util.IdleConnectionHandler - Adding connection at: 1362075335721
19:15:35.722 [main] DEBUG o.a.c.h.MultiThreadedHttpConnectionManager - Notifying no-one, there are no waiting threads
19:15:35.722 [main] WARN org.openrdf.http.client.HTTPClient - Server reports problem: No acceptable file format found.