SDN4 404 When POSTing commit - java

I am trying to create some tests for my Spring web app. I have some test classes which use MockMvc and a Cucumber test class using Selenium. All tests perform CRUD operations connected to an InProcessServer instance.
When running the tests using Gradle the MockMvc test classes run and pass but when the Cucumber test steps are executed I am getting the following:
2015-09-17 16:44:05 DEBUG org.apache.http.wire - http-outgoing-3 >> "POST /db/data/transaction/commit HTTP/1.1[\r][\n]"
2015-09-17 16:44:05 DEBUG org.apache.http.wire - http-outgoing-3 >> "Content-Type: application/json;charset=UTF-8[\r][\n]"
2015-09-17 16:44:05 DEBUG org.apache.http.wire - http-outgoing-3 >> "Accept: application/json;charset=UTF-8[\r][\n]"
2015-09-17 16:44:05 DEBUG org.apache.http.wire - http-outgoing-3 >> "User-Agent: neo4j-ogm.java/1.0[\r][\n]"
2015-09-17 16:44:05 DEBUG org.apache.http.wire - http-outgoing-3 >> "Content-Length: 131[\r][\n]"
2015-09-17 16:44:05 DEBUG org.apache.http.wire - http-outgoing-3 >> "Host: localhost:7478[\r][\n]"
2015-09-17 16:44:05 DEBUG org.apache.http.wire - http-outgoing-3 >> "Connection: Keep-Alive[\r][\n]"
2015-09-17 16:44:05 DEBUG org.apache.http.wire - http-outgoing-3 >> "Accept-Encoding: gzip,deflate[\r][\n]"
2015-09-17 16:44:05 DEBUG org.apache.http.wire - http-outgoing-3 >> "[\r][\n]"
2015-09-17 16:44:05 DEBUG org.apache.http.wire - http-outgoing-3 >> "{"statements":[{"statement":"MATCH (n:`User`) RETURN COUNT(n)","parameters":{},"resultDataContents":["row"],"includeStats":false}]}"
2015-09-17 16:44:05 DEBUG org.apache.http.wire - http-outgoing-3 << "HTTP/1.1 404 Not Found[\r][\n]"
2015-09-17 16:44:05 DEBUG org.apache.http.wire - http-outgoing-3 << "Date: Thu, 17 Sep 2015 15:44:05 GMT[\r][\n]"
2015-09-17 16:44:05 DEBUG org.apache.http.wire - http-outgoing-3 << "Cache-Control: must-revalidate,no-cache,no-store[\r][\n]"
2015-09-17 16:44:05 DEBUG org.apache.http.wire - http-outgoing-3 << "Content-Type: text/html; charset=ISO-8859-1[\r][\n]"
2015-09-17 16:44:05 DEBUG org.apache.http.wire - http-outgoing-3 << "Content-Length: 304[\r][\n]"
2015-09-17 16:44:05 DEBUG org.apache.http.wire - http-outgoing-3 << "Server: Jetty(9.2.4.v20141103)[\r][\n]"
2015-09-17 16:44:05 DEBUG org.apache.http.wire - http-outgoing-3 << "[\r][\n]"
2015-09-17 16:44:05 DEBUG org.apache.http.wire - http-outgoing-3 << "<html>[\n]"
2015-09-17 16:44:05 DEBUG org.apache.http.wire - http-outgoing-3 << "<head>[\n]"
2015-09-17 16:44:05 DEBUG org.apache.http.wire - http-outgoing-3 << "<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>[\n]"
2015-09-17 16:44:05 DEBUG org.apache.http.wire - http-outgoing-3 << "<title>Error 404 </title>[\n]"
2015-09-17 16:44:05 DEBUG org.apache.http.wire - http-outgoing-3 << "</head>[\n]"
2015-09-17 16:44:05 DEBUG org.apache.http.wire - http-outgoing-3 << "<body>[\n]"
2015-09-17 16:44:05 DEBUG org.apache.http.wire - http-outgoing-3 << "<h2>HTTP ERROR: 404</h2>[\n]"
2015-09-17 16:44:05 DEBUG org.apache.http.wire - http-outgoing-3 << "<p>Problem accessing /db/data/transaction/commit. Reason:[\n]"
2015-09-17 16:44:05 DEBUG org.apache.http.wire - http-outgoing-3 << "<pre> Not Found</pre></p>[\n]"
2015-09-17 16:44:05 DEBUG org.apache.http.wire - http-outgoing-3 << "<hr /><i><small>Powered by Jetty://</small></i>[\n]"
2015-09-17 16:44:05 DEBUG org.apache.http.wire - http-outgoing-3 << "</body>[\n]"
2015-09-17 16:44:05 DEBUG org.apache.http.wire - http-outgoing-3 << "</html>[\n]"
2015-09-17 16:44:05 INFO o.s.d.n.config.Neo4jConfiguration - Intercepted exception
What could be causing this? This must be the Neo4j server as there is no server running on port 7478 after the tests complete and it is also not the test web server as this is configured on a random port e.g.
2015-09-17 16:44:04 INFO o.s.b.c.e.j.JettyEmbeddedServletContainer - Jetty started on port(s) 37837 (http/1.1)
EDIT:
#Configuration
#EnableNeo4jRepositories(basePackages = "co.sens.data.repositories")
#EnableTransactionManagement
#ComponentScan("co.sens.data")
public class Neo4jTestConfiguration extends Neo4jConfiguration {
#Override
public SessionFactory getSessionFactory() {
return new SessionFactory("co.sens.data");
}
#Bean
#Override
public Neo4jServer neo4jServer() {
return new InProcessServer();
}
#Override
#Bean
public Session getSession() throws Exception {
return super.getSession();
}
}

Related

Read time out in Apache HTTP Client but request runs fine with curl

I have a PUT requests that is done by a dependency scanner we are using
I'm behind a corporate proxy
Request is done with Apache HTTP Client 4
I get a "read time out" after the configured timeout
I recreated the request with curl and this works fine (with the same proxy) and finishes within seconds
It works fine with Apache HTTP Client without the proxy.
So I'm trying to find out what config is missing in the HTTP client config or what else could be the error. Unfortunately neither our networking team nor the product vendor could help me out :-(
This is the curl request:
curl --connect-timeout 60 -m 60 -v -X PUT --data-binary #test.json
https://someblackduckserver/api/developer-scans/12345
-H "Content-type: application/vnd.blackducksoftware.developer-scan-1-ld-2+json"
-H "X-BD-DOCUMENT-COUNT: 1"
-H "Accept: application/vnd.blackducksoftware.scan-4+json"
-H "X-BD-MODE: append"
-H "X-BD-RAPID-SCAN-MODE: ALL" -H "X-BD-VERSION-NAME: scan-test"
-H "User-Agent: synopsys_detect/8.1.0-SNAPSHOT BlackDuckCommon/65.0.0 ..."
-H "X-BD-PROJECT-NAME: scan-test"
-H "Authorization: Bearer ..... left out ....."
Where test.json is a json file with about 1.3MB.
Minified code when using Apache HTTP Client:
RequestBuilder requestBuilder = RequestBuilder.create("PUT");
URIBuilder uriBuilder = new URIBuilder(new URI("https://someblackduckserver/api/developer-scans/12345"));
requestBuilder.setUri(uriBuilder.build());
Charset bodyEncoding = StandardCharsets.UTF_8;
requestBuilder.setCharset(bodyEncoding);
requestBuilder.addHeader("Content-type", "application/vnd.blackducksoftware.developer-scan-1-ld-2+json");
requestBuilder.addHeader("X-BD-DOCUMENT-COUNT", "1");
requestBuilder.addHeader("Accept", "application/vnd.blackducksoftware.scan-4+json");
requestBuilder.addHeader("X-BD-MODE", "append");
requestBuilder.addHeader("X-BD-RAPID-SCAN-MODE", "ALL");
requestBuilder.addHeader("X-BD-VERSION-NAME", "scan-test");
requestBuilder.addHeader("User-Agent", "synopsys_detect/8.1.0-SNAPSHOT BlackDuckCommon/65.0.0 ...");
requestBuilder.addHeader("X-BD-PROJECT-NAME", "scan-test");
requestBuilder.addHeader("Authorization", "Bearer ..... left out .....");
HttpEntity httpEntity = new FileEntity(new File("test.json"));
requestBuilder.setEntity(httpEntity);
HttpUriRequest request = requestBuilder.build();
HttpContext httpContext = new BasicHttpContext();
HttpClientBuilder clientBuilder = HttpClientBuilder.create();
RequestConfig.Builder defaultRequestConfigBuilder = RequestConfig.custom().setCookieSpec(CookieSpecs.STANDARD);
// set our proxy
defaultRequestConfigBuilder.setProxy(new HttpHost("..... (left out)", 8080));
// set timeout
int timeoutInSeconds = 60;
defaultRequestConfigBuilder.setConnectTimeout(timeoutInSeconds * 1000);
defaultRequestConfigBuilder.setSocketTimeout(timeoutInSeconds * 1000);
defaultRequestConfigBuilder.setConnectionRequestTimeout(timeoutInSeconds * 1000);
clientBuilder.setDefaultRequestConfig(defaultRequestConfigBuilder.build());
// for testing: ignore ssl
HostnameVerifier hostnameVerifier;
SSLContext sslContext = SSLContextBuilder.create().loadTrustMaterial(new TrustAllStrategy()).build();
hostnameVerifier = new NoopHostnameVerifier();
SSLConnectionSocketFactory connectionFactory = new SSLConnectionSocketFactory(sslContext, hostnameVerifier);
clientBuilder.setSSLSocketFactory(connectionFactory);
try (CloseableHttpClient client = clientBuilder.build()) {
CloseableHttpResponse closeableHttpResponse = client.execute(request, httpContext);
System.out.println(closeableHttpResponse);
}
I removed some sensitive details from the request.
Any idea what I'm missing here or what could go wrong?
Logs from a sample the call:
2022-07-25 10:38:38.201 [main] DEBUG o.a.h.c.protocol.RequestAddCookies - CookieSpec selected: default
2022-07-25 10:38:38.206 [main] DEBUG o.a.h.c.protocol.RequestAuthCache - Auth cache not set in the context
2022-07-25 10:38:38.207 [main] DEBUG o.a.h.i.c.PoolingHttpClientConnectionManager - Connection request: [route: {tls}->http://our.proxy.ip.address:8080->https://someblackduckserver.com:443][total available: 0; route allocated: 0 of 2; total allocated: 0 of 20]
2022-07-25 10:38:38.259 [main] DEBUG o.a.h.i.c.PoolingHttpClientConnectionManager - Connection leased: [id: 0][route: {tls}->http://our.proxy.ip.address:8080->https://someblackduckserver.com:443][total available: 0; route allocated: 1 of 2; total allocated: 1 of 20]
2022-07-25 10:38:38.260 [main] DEBUG o.a.h.impl.execchain.MainClientExec - Opening connection {tls}->http://our.proxy.ip.address:8080->https://someblackduckserver.com:443
2022-07-25 10:38:38.261 [main] DEBUG o.a.h.i.c.DefaultHttpClientConnectionOperator - Connecting to /our.proxy.ip.address:8080
2022-07-25 10:38:38.301 [main] DEBUG o.a.h.i.c.DefaultHttpClientConnectionOperator - Connection established 10.17.10.44:34272<->our.proxy.ip.address:8080
2022-07-25 10:38:38.317 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> CONNECT someblackduckserver.com:443 HTTP/1.1
2022-07-25 10:38:38.317 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Host: someblackduckserver.com
2022-07-25 10:38:38.317 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> User-Agent: Apache-HttpClient/4.5.13 (Java/11.0.13)
2022-07-25 10:38:38.317 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "CONNECT someblackduckserver.com:443 HTTP/1.1[\r][\n]"
2022-07-25 10:38:38.317 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Host: someblackduckserver.com[\r][\n]"
2022-07-25 10:38:38.317 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "User-Agent: Apache-HttpClient/4.5.13 (Java/11.0.13)[\r][\n]"
2022-07-25 10:38:38.317 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "[\r][\n]"
2022-07-25 10:38:38.346 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "HTTP/1.1 200 Connection established[\r][\n]"
2022-07-25 10:38:38.346 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Proxy-Agent: Proxy-Vendor-Proxy/1.0[\r][\n]"
2022-07-25 10:38:38.346 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "[\r][\n]"
2022-07-25 10:38:38.347 [main] DEBUG org.apache.http.headers - http-outgoing-0 << HTTP/1.1 200 Connection established
2022-07-25 10:38:38.347 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Proxy-Agent: Proxy-Vendor-Proxy/1.0
2022-07-25 10:38:38.347 [main] DEBUG o.a.h.impl.execchain.MainClientExec - Tunnel to target created.
2022-07-25 10:38:38.432 [main] DEBUG o.a.h.c.s.SSLConnectionSocketFactory - Enabled protocols: [TLSv1.3, TLSv1.2]
2022-07-25 10:38:38.440 [main] DEBUG o.a.h.c.s.SSLConnectionSocketFactory - Enabled cipher suites:[TLS_AES_256_GCM_SHA384, TLS_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_RSA_WITH_AES_256_GCM_SHA384, TLS_DHE_DSS_WITH_AES_256_GCM_SHA384, TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_DSS_WITH_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_RSA_WITH_AES_256_CBC_SHA256, TLS_DHE_DSS_WITH_AES_256_CBC_SHA256, TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_DSS_WITH_AES_128_CBC_SHA256, TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_DSS_WITH_AES_256_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_256_GCM_SHA384, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_EMPTY_RENEGOTIATION_INFO_SCSV]
2022-07-25 10:38:38.440 [main] DEBUG o.a.h.c.s.SSLConnectionSocketFactory - Starting handshake
2022-07-25 10:38:39.252 [main] DEBUG jdk.event.security - X509Certificate: ... our ssl inspect certificate ...
2022-07-25 10:38:39.252 [main] DEBUG jdk.event.security - X509Certificate: ... our internal certificate ...
2022-07-25 10:38:39.275 [main] DEBUG jdk.event.security - TLSHandshake: someblackduckserver.com:8080, TLSv1.2, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, 1942523025
2022-07-25 10:38:39.276 [main] DEBUG o.a.h.c.s.SSLConnectionSocketFactory - Secure session established
2022-07-25 10:38:39.276 [main] DEBUG o.a.h.c.s.SSLConnectionSocketFactory - negotiated protocol: TLSv1.2
2022-07-25 10:38:39.276 [main] DEBUG o.a.h.c.s.SSLConnectionSocketFactory - negotiated cipher suite: TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
2022-07-25 10:38:39.276 [main] DEBUG o.a.h.c.s.SSLConnectionSocketFactory - peer principal: CN=*.someblackduckserver.com, O="Synopsys, Inc.", L=Mountain View, ST=California, C=US
2022-07-25 10:38:39.276 [main] DEBUG o.a.h.c.s.SSLConnectionSocketFactory - peer alternative names: [*.someblackduckserver.com]
2022-07-25 10:38:39.276 [main] DEBUG o.a.h.c.s.SSLConnectionSocketFactory - issuer principal: ... our ssl inspect certificate ...
2022-07-25 10:38:39.276 [main] DEBUG o.a.h.i.c.DefaultManagedHttpClientConnection - http-outgoing-0: set socket timeout to 60000
2022-07-25 10:38:39.277 [main] DEBUG o.a.h.impl.execchain.MainClientExec - Executing request PUT /api/developer-scans/12345 HTTP/1.1
2022-07-25 10:38:39.277 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> PUT /api/developer-scans/12345 HTTP/1.1
2022-07-25 10:38:39.277 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Content-type: application/vnd.blackducksoftware.developer-scan-1-ld-2+json
2022-07-25 10:38:39.277 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> X-BD-DOCUMENT-COUNT: 1
2022-07-25 10:38:39.277 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Accept: application/vnd.blackducksoftware.scan-4+json
2022-07-25 10:38:39.277 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> X-BD-MODE: append
2022-07-25 10:38:39.277 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> X-BD-RAPID-SCAN-MODE: ALL
2022-07-25 10:38:39.277 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> X-BD-VERSION-NAME: rapid-scan-test-igl-2
2022-07-25 10:38:39.277 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> User-Agent: synopsys_detect/8.1.0-SNAPSHOT BlackDuckCommon/65.0.0 (Eclipse Foundation 11.0.12 amd64 Windows 10 10.0)
2022-07-25 10:38:39.277 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> X-BD-PROJECT-NAME: project_name
2022-07-25 10:38:39.278 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Authorization: Bearer ...
2022-07-25 10:38:39.278 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Content-Length: 287381
2022-07-25 10:38:39.278 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Host: someblackduckserver.com
2022-07-25 10:38:39.278 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Connection: Keep-Alive
2022-07-25 10:38:39.278 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Accept-Encoding: gzip,deflate
2022-07-25 10:38:39.278 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "PUT /api/developer-scans/12345 HTTP/1.1[\r][\n]"
2022-07-25 10:38:39.278 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Content-type: application/vnd.blackducksoftware.developer-scan-1-ld-2+json[\r][\n]"
2022-07-25 10:38:39.278 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "X-BD-DOCUMENT-COUNT: 1[\r][\n]"
2022-07-25 10:38:39.279 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Accept: application/vnd.blackducksoftware.scan-4+json[\r][\n]"
2022-07-25 10:38:39.279 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "X-BD-MODE: append[\r][\n]"
2022-07-25 10:38:39.279 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "X-BD-RAPID-SCAN-MODE: ALL[\r][\n]"
2022-07-25 10:38:39.279 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "X-BD-VERSION-NAME: rapid-scan-test-igl-2[\r][\n]"
2022-07-25 10:38:39.279 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "User-Agent: synopsys_detect/8.1.0-SNAPSHOT BlackDuckCommon/65.0.0 (Eclipse Foundation 11.0.12 amd64 Windows 10 10.0)[\r][\n]"
2022-07-25 10:38:39.279 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "X-BD-PROJECT-NAME: project_name[\r][\n]"
2022-07-25 10:38:39.279 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Authorization: Bearer ...[\r][\n]"
2022-07-25 10:38:39.279 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Content-Length: 287381[\r][\n]"
2022-07-25 10:38:39.279 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Host: someblackduckserver.com[\r][\n]"
2022-07-25 10:38:39.279 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Connection: Keep-Alive[\r][\n]"
2022-07-25 10:38:39.279 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Accept-Encoding: gzip,deflate[\r][\n]"
2022-07-25 10:38:39.423 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> .... all the logs for file content ....
2022-07-25 10:39:39.483 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "[read] I/O error: Read timed out"
2022-07-25 10:39:39.483 [main] DEBUG o.a.h.i.c.DefaultManagedHttpClientConnection - http-outgoing-0: Close connection
2022-07-25 10:39:39.483 [main] DEBUG o.a.h.i.c.DefaultManagedHttpClientConnection - http-outgoing-0: Shutdown connection
2022-07-25 10:39:39.483 [main] DEBUG o.a.h.impl.execchain.MainClientExec - Connection discarded
2022-07-25 10:39:39.483 [main] DEBUG o.a.h.i.c.PoolingHttpClientConnectionManager - Connection released: [id: 0][route: {tls}->http://our.proxy.ip.address:8080->https://someblackduckserver.com:443][total available: 0; route allocated: 0 of 2; total allocated: 0 of 20]
2022-07-25 10:39:39.484 [main] DEBUG o.a.h.i.c.PoolingHttpClientConnectionManager - Connection manager is shutting down
2022-07-25 10:39:39.484 [main] DEBUG o.a.h.i.c.PoolingHttpClientConnectionManager - Connection manager shut down
Exception in thread "main" java.net.SocketTimeoutException: Read timed out
at java.base/java.net.SocketInputStream.socketRead0(Native Method)
at java.base/java.net.SocketInputStream.socketRead(SocketInputStream.java:115)
at java.base/java.net.SocketInputStream.read(SocketInputStream.java:168)
at java.base/java.net.SocketInputStream.read(SocketInputStream.java:140)
at java.base/sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:478)
at java.base/sun.security.ssl.SSLSocketInputRecord.readHeader(SSLSocketInputRecord.java:472)
at java.base/sun.security.ssl.SSLSocketInputRecord.bytesInCompletePacket(SSLSocketInputRecord.java:70)
at java.base/sun.security.ssl.SSLSocketImpl.readApplicationRecord(SSLSocketImpl.java:1318)
at java.base/sun.security.ssl.SSLSocketImpl$AppInputStream.read(SSLSocketImpl.java:959)
at org.apache.http.impl.conn.LoggingInputStream.read(LoggingInputStream.java:84)
at org.apache.http.impl.io.SessionInputBufferImpl.streamRead(SessionInputBufferImpl.java:137)
at org.apache.http.impl.io.SessionInputBufferImpl.fillBuffer(SessionInputBufferImpl.java:153)
at org.apache.http.impl.io.SessionInputBufferImpl.readLine(SessionInputBufferImpl.java:280)
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:138)
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:56)
at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:259)
at org.apache.http.impl.DefaultBHttpClientConnection.receiveResponseHeader(DefaultBHttpClientConnection.java:163)
at org.apache.http.impl.conn.CPoolProxy.receiveResponseHeader(CPoolProxy.java:157)
at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:273)
at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:272)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
at org.example.BdTest.main(BdTest.java:93)
May be not a solution but a workaround if it works. I wrote my own Http client that is much simpler than Apache Http client. The reason I wrote it is that in many cases you just need a simplistic functionality so using a thin library lessens complexity and allows you to debug it if need be and it would allow you easier way to get to the bottom of the problem. So, may be you can give it a shot. At may even work or if not than it would be much easier to debug than Apache Http client. My Http client is part of MgntUtils Open-Source library written and maintained by me. Here is HttpClient Javadoc. The library can be obtained as Maven artifact from Maven Central and from Github (including source code and Javadoc)

Kerberos POST request returns 401 error with Java

I'm using KerberosTemplate to make a POST request to a kerberos authenticated rest API.
I can successfully run an insecure request on the command line but when I try to do a secure call with HTTP client It returns a 401 unauthorized error.
I tried to turn of certificate checking as we dont use it and I also tries the username without the domain but that has no affect either.
I also tried to kerb4j rest template too but I get the same issue. From the code you can also see that Im checking the keytab file exists as well.
Appreciate some help, thanks.
import ErrorHandlers.KerberosRestTemplateResponseErrorHandler;
import POJOs.PostBody;
import POJOs.PostResponse;
import com.fasterxml.jackson.databind.SerializationFeature;
//import com.kerb4j.client.spring.KerberosRestTemplate;
import org.springframework.security.kerberos.client.KerberosRestTemplate;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.conn.ssl.TrustStrategy;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import javax.net.ssl.SSLContext;
import java.io.File;
import java.security.KeyManagementException;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.cert.X509Certificate;
public class KerbTemplate {
public static void main(String[] args) throws KeyStoreException, NoSuchAlgorithmException, KeyManagementException {
PostBody postRequestBody = new PostBody();
postRequestBody.setAggregation("data");
postRequestBody.setEndDate("2119-03-30");
postRequestBody.setStartDate("1900-03-30");
postRequestBody.setMetadata(new String[] {"PARTIAL"});
postRequestBody.setSymbols(new String[] {"requestdata"});
postRequestBody.setModifiedDate("2019-07-20");
postRequestBody.setFirstWeekday("0");
TrustStrategy acceptingTrustStrategy = ((X509Certificate[] chain, String authType) -> true);
SSLContext sslContext = org.apache.http.ssl.SSLContexts.custom().loadTrustMaterial(null, acceptingTrustStrategy).build();
SSLConnectionSocketFactory csf = new SSLConnectionSocketFactory(sslContext);
CloseableHttpClient httpClient = HttpClients.custom().setSSLSocketFactory(csf).build();
HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory();
requestFactory.setHttpClient(httpClient);
String base = System.getProperty("user.dir");
String keytab = base+ File.separator+"src"+File.separator+"main"+File.separator+"resources"+File.separator+"username.keytab";
System.out.println(keytab);
File f = new File(keytab);
if(f.exists() && !f.isDirectory()) {
System.out.println("File exists");
}
KerberosRestTemplate kerberosRestTemplate = new KerberosRestTemplate( keytab,"'username#domain",requestFactory.getHttpClient());
kerberosRestTemplate.setErrorHandler(new KerberosRestTemplateResponseErrorHandler());
MappingJackson2HttpMessageConverter jsonHttpMessageConverter = new MappingJackson2HttpMessageConverter();
jsonHttpMessageConverter.getObjectMapper().configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
kerberosRestTemplate.getMessageConverters().add(jsonHttpMessageConverter);
// Add CSRF header if required:
HttpHeaders headers = new HttpHeaders();
headers.set("X-Requested-By", "'username#domain");
headers.setContentType(MediaType.APPLICATION_JSON);
headers.set("Client-Type","Web");
headers.set("Client-UI-Component","Jim");
HttpEntity<PostBody> postRequest = new HttpEntity<PostBody>(postRequestBody, headers);
PostResponse pr = kerberosRestTemplate.postForObject("https://url.com/1/data/loadList", postRequest, PostResponse.class);
}
}
package ErrorHandlers;
import org.springframework.http.HttpStatus;
import org.springframework.http.client.ClientHttpResponse;
import org.springframework.web.client.ResponseErrorHandler;
import java.io.IOException;
public class KerberosRestTemplateResponseErrorHandler implements ResponseErrorHandler {
#Override
public boolean hasError(ClientHttpResponse httpResponse) throws IOException {
return (
httpResponse.getStatusCode().series() == HttpStatus.Series.CLIENT_ERROR
|| httpResponse.getStatusCode().series() == HttpStatus.Series.SERVER_ERROR);
}
#Override
public void handleError(ClientHttpResponse httpResponse) throws IOException {
System.out.println("Error Response code " + httpResponse.getRawStatusCode());
System.out.println(httpResponse.getStatusText());
System.out.println(httpResponse.getBody().toString());
}
}
Updated with Partial logs
1:56:58.233 [Finalizer] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection manager is shutting down
21:56:58.245 [Finalizer] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection manager shut down
21:58:30.261 [main] DEBUG org.springframework.security.kerberos.client.KerberosRestTemplate - HTTP POST myendpoint.com
21:58:30.460 [main] DEBUG org.springframework.security.kerberos.client.KerberosRestTemplate - Accept=[application/json, application/*+json]
21:58:30.500 [main] DEBUG org.springframework.security.kerberos.client.KerberosRestTemplate - Writing [ClassPojo [firstWeekday = 0, metadata = [Ljava.lang.String;#2f465398, endDate = 2119-03-30, modifiedDate = 2019-07-20, aggregation = DAILY, symbols = [Ljava.lang.String;#548e6d58, startDate = 1900-03-30]] as "application/json"
21:58:30.540 [main] DEBUG org.apache.http.client.protocol.RequestAddCookies - CookieSpec selected: default
21:58:30.561 [main] DEBUG org.apache.http.client.protocol.RequestAuthCache - Auth cache not set in the context
21:58:30.565 [main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection request: [route: {s}->myendpoint.com:443][total kept alive: 0; route allocated: 0 of 2; total allocated: 0 of 20]
21:58:30.587 [main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection leased: [id: 0][route: {s}->myendpoint.com:443][total kept alive: 0; route allocated: 1 of 2; total allocated: 1 of 20]
21:58:30.591 [main] DEBUG org.apache.http.impl.execchain.MainClientExec - Opening connection {s}->myendpoint.com:443
21:58:30.617 [main] DEBUG org.apache.http.impl.conn.DefaultHttpClientConnectionOperator - Connecting to myendpoint.com:443
21:58:30.617 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory - Connecting socket to myendpoint.com:443 with timeout 0
21:58:30.747 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory - Enabled protocols: [TLSv1, TLSv1.1, TLSv1.2]
21:58:30.747 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory - Enabled cipher suites:[TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384, TLS_DHE_RSA_WITH_AES_256_CBC_SHA256, TLS_DHE_DSS_WITH_AES_256_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_DSS_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_DSS_WITH_AES_128_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, TLS_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384, TLS_DHE_RSA_WITH_AES_256_GCM_SHA384, TLS_DHE_DSS_WITH_AES_256_GCM_SHA384, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_DSS_WITH_AES_128_GCM_SHA256, TLS_EMPTY_RENEGOTIATION_INFO_SCSV]
21:58:30.747 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory - Starting handshake
21:58:30.923 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory - Secure session established
21:58:30.923 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory - negotiated protocol: TLSv1.2
21:58:30.924 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory - negotiated cipher suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
21:58:30.933 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory - peer principal: CN=myendpoint.com, O=EXAMPLE p.l.c.
21:58:30.934 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory - peer alternative names: [myendpoint.com]
21:58:30.962 [main] DEBUG org.apache.http.impl.execchain.MainClientExec - Executing request POST /1/data/loadList HTTP/1.1
21:58:30.963 [main] DEBUG org.apache.http.impl.execchain.MainClientExec - Target auth state: UNCHALLENGED
21:58:30.968 [main] DEBUG org.apache.http.impl.execchain.MainClientExec - Proxy auth state: UNCHALLENGED
21:58:30.976 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> POST /1/data/loadList HTTP/1.1
21:58:30.979 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Accept: application/json, application/+json
21:58:30.979 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Client-Type: Fred
21:58:30.980 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Content-Type: application/json
21:58:30.981 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Client-UI-Component: Jim
21:58:30.981 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Content-Length: 220
21:58:30.982 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Host: myendpoint.com
21:58:30.983 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Connection: Keep-Alive
21:58:30.983 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> User-Agent: Apache-HttpClient/4.5.9 (Java/1.8.0_212-3-redhat)
21:58:30.983 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Accept-Encoding: gzip,deflate
21:58:30.984 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "POST /1/data/loadList HTTP/1.1[\r][\n]"
21:58:30.984 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Accept: application/json, application/+json[\r][\n]"
21:58:30.984 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Client-Type: Fred[\r][\n]"
21:58:30.985 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Content-Type: application/json[\r][\n]"
21:58:30.986 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Client-UI-Component: Jim[\r][\n]"
21:58:30.986 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Content-Length: 220[\r][\n]"
21:58:30.986 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Host: myendpoint.com[\r][\n]"
21:58:30.988 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Connection: Keep-Alive[\r][\n]"
21:58:30.990 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "User-Agent: Apache-HttpClient/4.5.9 (Java/1.8.0_212-3-redhat)[\r][\n]"
21:58:30.990 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Accept-Encoding: gzip,deflate[\r][\n]"
21:58:30.991 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "[\r][\n]"
21:58:30.992 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "{"firstWeekday":"0","metadata":["All"],"endDate":"2119-03-30","modifiedDate":"2019-07-20","aggregation":"DAILY","symbols":["symbol1","symbol2"],"startDate":"1900-03-30"}"
21:58:31.043 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "HTTP/1.1 401 [\r][\n]"
21:58:31.043 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Access-Control-Allow-Credentials: true[\r][\n]"
21:58:31.043 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Access-Control-Allow-Methods: POST, GET, OPTIONS, DELETE[\r][\n]"
21:58:31.043 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Access-Control-Max-Age: 3600[\r][\n]"
21:58:31.043 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Access-Control-Allow-Headers: Client-Type, Content-Type, Accept, X-Requested-With, Authorization, rejectunauthorized[\r][\n]"
21:58:31.044 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "WWW-Authenticate: Negotiate[\r][\n]"
21:58:31.044 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "X-Content-Type-Options: nosniff[\r][\n]"
21:58:31.044 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "X-XSS-Protection: 1; mode=block[\r][\n]"
21:58:31.044 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Cache-Control: no-cache, no-store, max-age=0, must-revalidate[\r][\n]"
21:58:31.044 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Pragma: no-cache[\r][\n]"
21:58:31.044 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Expires: 0[\r][\n]"
21:58:31.044 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Strict-Transport-Security: max-age=31536000 ; includeSubDomains[\r][\n]"
21:58:31.044 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "X-Frame-Options: DENY[\r][\n]"
21:58:31.044 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Transfer-Encoding: chunked[\r][\n]"
21:58:31.044 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Date: Wed, 11 Sep 2019 20:58:31 GMT[\r][\n]"
21:58:31.044 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "[\r][\n]"
21:58:31.050 [main] DEBUG org.apache.http.headers - http-outgoing-0 << HTTP/1.1 401
21:58:31.050 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Access-Control-Allow-Credentials: true
21:58:31.050 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Access-Control-Allow-Methods: POST, GET, OPTIONS, DELETE
21:58:31.051 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Access-Control-Max-Age: 3600
21:58:31.051 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Access-Control-Allow-Headers: Client-Type, Content-Type, Accept, X-Requested-With, Authorization, rejectunauthorized
21:58:31.051 [main] DEBUG org.apache.http.headers - http-outgoing-0 << WWW-Authenticate: Negotiate
21:58:31.051 [main] DEBUG org.apache.http.headers - http-outgoing-0 << X-Content-Type-Options: nosniff
21:58:31.051 [main] DEBUG org.apache.http.headers - http-outgoing-0 << X-XSS-Protection: 1; mode=block
21:58:31.051 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Cache-Control: no-cache, no-store, max-age=0, must-revalidate
21:58:31.051 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Pragma: no-cache
21:58:31.051 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Expires: 0
21:58:31.051 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Strict-Transport-Security: max-age=31536000 ; includeSubDomains
21:58:31.051 [main] DEBUG org.apache.http.headers - http-outgoing-0 << X-Frame-Options: DENY
21:58:31.051 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Transfer-Encoding: chunked
21:58:31.051 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Date: Wed, 11 Sep 2019 20:58:31 GMT
21:58:31.063 [main] DEBUG org.apache.http.impl.execchain.MainClientExec - Connection can be kept alive indefinitely
21:58:31.063 [main] DEBUG org.apache.http.impl.auth.HttpAuthenticator - Authentication required
21:58:31.063 [main] DEBUG org.apache.http.impl.auth.HttpAuthenticator - myendpoint.com:443 requested authentication
21:58:31.063 [main] DEBUG org.apache.http.impl.client.TargetAuthenticationStrategy - Authentication schemes in the order of preference: [Negotiate, Kerberos, NTLM, CredSSP, Digest, Basic]
21:58:31.081 [main] DEBUG org.apache.http.impl.auth.SPNegoScheme - Received challenge '' from the auth server
21:58:31.082 [main] DEBUG org.apache.http.impl.client.TargetAuthenticationStrategy - Challenge for Kerberos authentication scheme not available
21:58:31.083 [main] DEBUG org.apache.http.impl.client.TargetAuthenticationStrategy - Challenge for NTLM authentication scheme not available
21:58:31.083 [main] DEBUG org.apache.http.impl.client.TargetAuthenticationStrategy - Challenge for CredSSP authentication scheme not available
21:58:31.083 [main] DEBUG org.apache.http.impl.client.TargetAuthenticationStrategy - Challenge for Digest authentication scheme not available
21:58:31.083 [main] DEBUG org.apache.http.impl.client.TargetAuthenticationStrategy - Challenge for Basic authentication scheme not available
21:58:31.093 [main] DEBUG org.springframework.security.kerberos.client.KerberosRestTemplate - Response 401 UNAUTHORIZED
Error Response code 401
21:58:31.096 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "0[\r][\n]"
21:58:31.097 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "[\r][\n]"
21:58:31.097 [main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection [id: 0][route: {s}->myendpoint.com:443] can be kept alive indefinitely
21:58:31.097 [main] DEBUG org.apache.http.impl.conn.DefaultManagedHttpClientConnection - http-outgoing-0: set socket timeout to 0
21:58:31.097 [main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection released: [id: 0][route: {s}->myendpoint.com:443][total kept alive: 1; route allocated: 1 of 2; total allocated: 1 of 20]
Process finished with exit code 0

Java convert json rest api response to image

I am connecting to a third party rest application (with limited documentation) and one of the requests returns a jpeg. I normally use an ObjectMapper to convert the json response to an object which works fine but I don't know how to convert the following response to an image:
10:18:29.885 [main] DEBUG org.apache.http.headers - http-outgoing-0 << HTTP/1.1 200 OK
10:18:29.885 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Cache-Control: no-cache, must-revalidate
10:18:29.885 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Content-Length: 25001
10:18:29.885 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Connection: close
10:18:29.885 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Content-Type: image/jpeg
10:18:29.885 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Date: Thu, 27 Jul 2017 09:18:29 GMT
10:18:29.897 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "[0xb1][0xe7][0x8b][0x2][0xdb]K[0xe][0xde]c[0xf1][0x9c][0xff][0x0]t`z[0xe7][0x9a][0xda]{{Ym[0xd6][0x1f]*?%W[0x8][0xaa][0x0][\n]"
10:18:29.897 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "=[0xb1][0xd3][0xf0][0xaa][0x1]"[0xd3][0xad]m[0xe1]x[0x84]~`[0x94][0xee][0x95][0xe5];[0x9e]F[0xfe][0xf3][0x13][0xc9]?[0xcb][0xb6]+/P[0x96]M[0x1c]([0xb0]v[0xb8][0x99][0xff][0x0][0xd5]i[0xf9][0xc9][0x93][0xe8][0x84]z[0xb1][0xe0]{[0xf4][0xaa][0xd3][0xdd]j[0x8]|[0x8d][0x9][0xcd][0xdc] [0xe2]I[0xa4][0x19]XG}[0x87][0xf8][0xdb][0xd0][0xe]={U[0xed]0[0xd9].[0xf1][0xb]9[0xb9][0xf5][0xcd]9[0xfd][0xf3][0x9f][0xf6][0x8f][0xa0][0xe0]zS[\r][0x88][0xb4][0xc9][0x16]y[0xd6]mI[0x87][0xf6][0x92][0x8e]"n[0x12][0xc][0xf5][0x11][0x8e][0xff][0x0][0xef]u>[0xc3][0x8a][0xd2][0xbc]ke[0xb6][0x91][0xaf][0xc]b[0x4][0x19]s![0xc2][0xaf][0xbf][0xb5]T[0xd4][0xa4][0xb4][\n]"
10:18:29.897 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "[0xb1]O[0x19][0x9a]g[0xff][0x0]U[0x14]c2[0xb7][0xfb][0xbe][0x83][0xdc][0xe0][0xe][0xf5][0x99][0x5][0x96][0xa1]o2[0xdd]jc[0xed][0x91]![0xcc]0)[0xdc]-[0x87]c[0xfe][0xdb][0xb5][0xdb][0xb6];[0x81][0xe6]4[[0xea]7Ro[0x8d]e[0x1a]?k9[0x18][0xac][0xb3][0xfb][0xfa][0xaa][0xb3][0xd4][0xf7][0xad][0xfb];[0xcb]y[0xd0]$[0x18]M[0x83][0x1e]V[0xdd][0xa5]1[0xdb][0x1e][0x9f]J[0x8e];[0xc8]&[0x89][0xa6]IT[0xa2][0x8c][0xb1]'[0x1b]G[0xbf][0xa5]d[0xde]E.[0xbb][0x8f][0xb2]3[0xd9][0xc5][0xff][0x0]?[0xea]1#[0x8f]H[0xc7][0xa7][0xfb]G[0xf0][0xf5][0xa6]+[0x97]5;[0x84][0xbd]v[0xb2][0xb5][0x85].n[0x93][0xef]HN[0x12][0xdf][0xd0][0xb3][0xe][0xff][0x0][0xec][0x8e]O[0xb7]Z[0xaf]a[0x14][0xba][0x1e][0xf7][0xbb]f[0xbe]i1[0xe6][0xdf][0x11][0xfb][0xc3][0xec]Ge[0x1d][0x80][0xe0]{[0x9a][Y[0xbf][0xb2]bKY[0xe0]X[0xe0]^[0x12]X[0x87][0xca]O[0xab]{[0x9f]^[0xf5]b[0xe3]RDe[0x8a][0x5][0xfb]M[0xc3][0xae]V([0xc8][0xe9][0xea][0xc7][0xa2][0xaf][0xb9][0xfc][0x1][0xe9]E[0x82][0xe5][0xd9]5;Xm[0xfe][0xd2][0xf3][0xa8][0x88][0xe0][0x2]9,O#[0x7]R}[0x87]5[0x8f]w[0xa5][0xcf][0xac][0xca][0xb7]S[0x8f][0xb1]"[0x1d][0xc9]m[0xc1]3zy[0xdd][0xb1][0xfe][0xc8][0xfc]s[0xd0]Go[0xa2]Omr[0xda][0x8a][0xcc][0x92]^7[0xfc][0xb3][0xdb][0x88]c[0x1f][0xdd]A[0xdb][0xdd][0xba][0x9f]j[0xd0][0x8f]S[0x84][0xab][0xb][0x83][0xf6]W[0x8c]e[0xd6]S[0x80][0x7][0xae]{[0xd0][0x4][0xf6][0xfa][0x9e]d[0x16][0xf7]k[0xe4]\v[0x1f][0xc2][0xff][0x0][0xee][0x9f][0xe9]P]_I|[0xd2]Y[0xe9][0xea][0x8f][0x82]Rk[0x99][0x6][0xe8][0xa2]=[0xc0][0x1f][0xc6][0xfe][0xc3][0x81][0xdc][0xf6][0xaa][0x97]1I[0xaf][0xc2]b`[0xf6][0xf6][\r][0xfc]x[0xdb]4[0xbf][0xee][0xff][0x0]q}[0xfa][0x9f]a[0xc9]t/&[0x8f][0x12]#P=[0x94]`*4k[0x83][0x18][0xf4]#[0xd2][0x81][0x8b]e[0xa7][0xb7][0x87]a1[0xda][0x17][0xb9][0xb7]c[0xbe]_1[0xb7]J[[0xbb][0x13][0xdf][0xfa]t[0x18][0xab]R[0xeb][0x16][0xeb][\n]"
10:18:29.897 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<e[0xa7][0x92]RDPF?x[0xe7][0xb8][0xc7]lw'[0x81]PM[0xaa][0xac][0x8d][0xe4][0xd8][0x85][0xb9][0x9c][0x80]O8H[0x87][0xab][0x9e][0xdf]N[0xa7][0xdb][0xad]T[0x8f]J[0xfb],[0xf2]_Ap[P[0x98]bYXa\[0xe][0x8a][0x17][0xf8]Tz~'[0x9e]h[0x11]'[0xf6];]]&[0xa5]}([0x17][0xe8][0x8][0x80][0xc5][0xf7]-[0x81][0xea][0x17][0xfb][0xc4][0xf7]c[0xd7][0xb6][0x5]X:[0x89][0xb1]R5[0x12][0xb1]"[0x8c][0xfd][0xa3]8L{[0xfa]UW[0xd7]"[0x83][0x9]z[0xa6][0x9][0xb3][0xb5]P|[0xde]i[0xec][0x13][0x1c][0x92]})[0xaf]lu<>[0xa9][0x18][0xf2][0x1][\r][0x1d][0x96]r[0xa0][0x8e][0x8d]![0x1f]y[0xbd][0x7]A[0xee]y[0xa7]`%u[0x97]Z[0x1f][0xbe]W[0x87]Ma[0xc4]G*[0xf7]#[0xd5][0xfb][0xaa][0x1f][0xee][0xf5]=[0xf0]8[0xa7][0xb5][0xb3]Z|[0xd6]$F?[0xe7][0x81][0xfb][0x87][0xe9][0xe9]P[0xb9][0xb8][0xb2]R`c<#[0x93][0x1b][0x9f][0x99]G[0xb1][0xac][0xf8]56[0xd7]c&[0xda]W[0x86][0xcf]8i[0x1][0xc4][0x92]{/[0xf7]W[0xfd][0xae][0xa7][0xb7][0xad][0x16][0x15][0xce][0x96][0x1d]Y[0xf5]e?[0xd8][0xdb]^,[0xed]k[0xd9][0x1][0xf2][0xd4][0xf7][\n]"
10:18:29.898 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "[0xbd]\[0xfe]C[0xde][0x88]|<[0x96]2[0xc9]wa3%[0xe4][0xbf][0xeb][0xa4][0x93][0x9f];[0xd8][0xf6][0x3][0xd8][0xc][0xf]J[0xb2]t[0x81]n|[0xcd]8[0x8b]W[0x3][0xee]*[0xe2]6[0xf6][0xc7]j[0xab][0xff][0x0][0x9][0x16][0xdb][0xcf][0xec][0xc3]lN[0xa7][0x8c][0xf9][[0xb1][0x18][0x7][0xa1]g[0xe8][0x1][0xf4][0xe4][0x9e][0xc0][0xd6]z[0x96]Z[0x1a][0xd4][0x16][0xca]WT+b[0xeb][0xd5][0xa4]l#}[0xf][0xf4][0xa8][0xee]c[0xb8][0xd6][0xe3]1,F[0xd2][0xd1][0xba][0xcd]*~[0xf9][0xbd][0xd1]O[0xdc][0xfa][0xb7]>[0xd5]![0xd0][0xa3][0xbd]+.[0xac][0xc2][0xf6]e[0xe5][0x6]6[0xc7][0x9][0xff][0x0]a}}[0xce]M<[0xa5][0xe6][0x9d][0xf7]7^[[0xf][0xe1]?[0xeb][0x10]{z[0xff][0x0][0x9e][0x94]z[0x1]J[0xcb]O[0x9b][0xc3][0xd1][0x98][0xed][0x90][0xdd]Y[0xe7]sg[0x99][0x87][0xb9]=[[0xf1][0xfd]*[0xf3]j[0xd6][0xb]m[0xf6][0x83]p[0xa1]3[0xb4][0xc][0x1d][0xc5][0xbd][0x2][0x8e]I[0xf6][0x15][0x5][0xb6][0xb8][0xba][0xba][0xb0][0xd1][0x2]\[0xed];^[0xe5][0xce]"[0x88][0xfa]q[0xcb][0x11][0xe8]?1Q[0x1f][0xe]G[0x15][0xd1][0xd4]R[0xe1][0xce][0xa6]F[\r][0xcb][0x1][0x82]?[0xba][0x14]p[0xa3][0x8e][0xdf][0x8e]i[0xa0])[0xdf]i[0x97][0xda][0xb3][0xf9][0xf6][0xee][0xfa]:[0x8c][0x92]T[0xe2]i[0xbd][0x9b][0x1c] [0xfa]d[0x9a][0xb1]gu[0x15][0x82][0xad][0x94][0xd6][0xcb]b[0x87]h[0xfd][0xdb][0xfb][0xe7][0xd7][0xeb]S[0x8d]S[0xec][0xff][0x0][0xbb][0xd4][0x95]m[0x98][0xcb]Rv[0xde][0xf9][0xed]U[0xe7][0xb8][0x93]W[0x88][0xc5]e[\n]"
10:18:29.898 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "[0x9b]v[0xeb]w:[0x9d][0x9f]T^[0xac]}[0xf8][0x1f]^[0x94][0xc0][0x9b]S[0x9a][0xce]8B][0x95]}[0xff][0x0]r07;[0x1f][0xf6]#[0xe4][0x9f][0xa7][0xf2][0xac]/'V[0x8d][0xc9][0x97][0xce]M3[0xb5][0xba]?[0xfa]#[0x1f][0xed]0[0xe8]?[0xd9][0x1f][0x89][0xab][0xb6][0x9a]T[0xba][0x9]g[0x80][0xbd][0xf2]?[0xdf]yNf[0x1e][0xc0][0xfa][0xb2]8[0xf6][0xab][0x83]Q[0xb4]xZ=Q[0x13][0xef][0x17]8+[0xf5][0xa6]H[0xdd]=[0xac][0xbe][0xce][0x16][0xc8]"F[0xbc][0x94]Q[0x82][0xf][0xb8][0xf5][0xf7][0xaa][0xba][0x8a]Z[0xda]0[0x9d]'[0xfb]5[0xc3][0x1f][0x94] [0xc9][0x94][0xfa]m[0x1c][0x9f][0xc3][0xeb]T[0xaf]c[0x9b]Rq.[0x9a][\r][0x89][0xeb][0xf6][0xb7]\[0x17][0x1f][0xec][0xa7][0xf7][0x8e]>[0x87][0xb1]k2[0xe9][0xdb][0xbe][0xd1][0x3][0x1b][0xbd][0xbc][0xcc][q[0x9b][0xfe][0x4]z}8[0x14][0x5][0xc6]&[0xa5]yw[0xba]=Q[0xff][0x0][0xb1][0xd4][0xc][0xed][0xc][0x3]8[0xf5]/[0xd1]~[0x83][0xf3][0x15][0x93]y[0xae]iS#[0xe9][0xba][0x6][0x9e]uk[0xc1][0xff][0x0]<[0x6][0x12]3[0xfd][0xe7][0x90][0xff][0x0][0x93]F[0xab][0xe1][0x9b][0x9f][0x10][0xb0][0xbc][0xf1][0xe][0xa4][0xb6]v[0xb1][0x9c][0xa5][0xa5][0xb9][0x1b]c[0x1f][0xed]9[0xe0][0x93][0xec]>[0x95]5[0xac][0x17][0x1a]T"-[0x1e][0x3][0x16][0x95][0xd5][0xa6][0x92]1[0xe6][0x9f][0xf6][0x95]z[0x9f][0xab]q[0xed][0xde][0x8d]#[0xe4]5[0xaf][0x8]j[0x92][0xb2]_[0xf8][0x83]RR[0xd2]|[0xab][0x1c][0x0][0xca][0xeb][0xe8][0xaa][0xf]_[0xc3]=:[0xd7]=[0xaa]x;R[0xd3][0xa0][[0xb1][0x11][0x96][0xd9][0xf9]V^X[0xf]p:[0x1f]n[0xa2][0xbd][0xaa][0xca]+U[0x6][0xe2][0xc][0xcb]#[0x8c]4[0xce]wH}[0x89]=>[0x94][0xcb][0x9b]H[0xed][0xa2][0x92][0xe6]'[0x8a][0x4]#[0xf7][0x91][0xcd][0xfe][0xa9][0xfe][0xa3][0xd7][0xfc][0x8a][0x97][0x1]\[0xf9][0xeb][0x4]S[0x83][0x15][0xaf]I[0xd5][0xfc]#m[0xe2]6[0x92][0xe7]J[0xb5]k[0x9][0xd4]nh[0xe6][0xe0][0xca]q[0xfc][0xb][0xd4][0x8f]s[0x83][0xec]k[0xce][0xae]m[0xa5][0xb4][0x9d][0xe0][0x9d][\n]"
10:18:29.898 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "H[0x87][0x4]VMXm[0x16],u[[0x9d]:t[0xb8][0xb6].T[0xfb][0xae]:[0x8a][0xe9][0xb4]o[0x88][0x9a][0x9d][0x8e][0xa0].nH[0x9c]7[0xe][0xcc]2[0xfb]}[0x8d]q[0x95][0xb7][0xe1]=[0x19][0xb5][0xbd]j[0xb]\e3[0xb9][0xc9][0x19][0xc0][0x14]!\[0xf7][0x89]u=6[0xff][0x0]N[0xb7][0x92]h[0xcc][0xe6][0xe9]7En[0x8b][0xba]V[0xf5][0xda]==[0xce][0x7][0xad]f[0xc5][0xa3][0xea](wN[0x4][0x96][0x0][0xe5]4[0xc5][0x93];G[0xfb]L>[0xf1][0xff][0x0]d|[0xa3][0xd0][0xd5][0xbb][0x1d][0x1e]M[0x5][0x19][0xb4][0xf0]n[0x15][0xf1][0xe6]$[0xcd][0x99][0xe]=[0x1c][0xf3][0xf4][0x1d]=[0xaa][0xd7][0xf6][0xe5][0x9f][0xcb][0x1f][0xef][0x1a][0xe9][0xb8][E\[0xca][0xc7][0xbe][0x7][0xa7][0xbf]A[[0x14]Om}k$D#,B%[0xe6]6[0x1]v[0x1][0xed][0xd8]V}[0xd9]:[0xca][0x11][0xa7][0xc2][0xf][0x18][0x17][0xf2][0x2][0x11]}[0xd0]u[0x93][0xf9]{[0xd2][0xdc][0xe8]'Y[0x91].5m[0xab][0xb0][0xee][0x8a][0xde][0x13][0x95]C[0xd8][0xb9][0xff][0x0][0x96][0x84]z}[0xd1][0xdb][0xd6][0xa7][0x92][0xfa]}1[0x19][0xaf][0xf0][0xf6][0xe8]2nW[0xf8]G[0xab][0xe][0xdf]Z[0x0][0xa9]e[0x4][0xba][0x12][0xb7][0x9f][0xbe][0xf1]\[0xe6]K[0xd3][0xcc][0xad][0xfe][0xff][0x0][0xb7][0xb0][0xe0]U[0xe9][0xb5][X[0xd2]2[0x8e]f[0x92]_[0xf5]qB7;[0xfd][0x7]a[0xee]p[0x5]A[0x16][0xa5]6[0xab][0x10]}1T[[0xbf]K[0xc9]G[0xca][0xc3][0xd5][0x13][0xab]}N[0x7][0xd7][0xa5]C[0x6][0x84][0xba]{[0xcb]sc+[0xb][0xb9][0x8e]f[0x92]^|[0xef]c[0xe8][0x7]`8[0x14][0xc4]C>[0x87]&[0xa5]p[0xb7][0x97]L[0x96][0xee][0x87]tv[0xb1][0xfc][0xc9][0x9f]Y[0xf][0xf1][0x9f][0xd0]{[0xd5][0xc4][0xd4][0x1a]7[0x11]^[0xa7][0x93]![0xe8][0xe3][0xee]7[0xbe]{T2k[0xb0][0xdb][0xc8][0x96][0xd7][0x88][0xd1]^I[0xc4]p([0xdc]f?[0xec]z[0xff][0x0]![0xeb]Iq[0xa7]I[0xab][0xc6]c[0xd4][0x80][V?[0xf1][0xe8][0x87];[0xbf][0xdf]a[0xd7][0xe8]8[0xfa][0xd0][0x1e][0xa0][0xf7][0x92]j [0xc7]`[0x17][0xc9]<5[0xdc][0x8b][0xb9][0xf][0xa8]E[0xfe]?[0xaf][0xdd][0xfa][0xd4][0x16][0x9a]ch[0x8a][0xc3]O[0xdd],n[0xdb][0xa5][0x8e]V[0xcb][0xc8][0xdd][0xdb]w[0xaf][0xf9][0x3][0xb5]N#[0x9f]M[0x0]D[0xa6][0xe2][0xd9]F<[0xbf][0xe3]A[0xed][0xea]=[0xaa]([0xf5]Q[0xa9][0xa9][0x1a]K$[0xa0][0x1d][0xaf]p[0xff][0x0][0xea][0xe3]=[0xc7][0xfb]M[0xec]8[0xf5]4[0xc4]Z[0x1a][0xd5][0xae][0xc5][0xb][0xbd][0xe7]bB[0xdb]([0xcc][0x84][0xfd]==[0xfa][0xe][0xf5]R[0xef]K[0x1a][0xa3]$[0xfa][0x99][0x1b][0xe2];[0xa0][0x86]3[0x95][0x84][0xf6]$[0xff][0x0][0x1b]~[0x83][0xb0][0xef]J[0xba],qH[0xf7]Q[0xcc][0xe6][0xf9][0xfe][0xfd][0xd3][0x9c][0xb3][0xfb][0x1e][0xc1]}[0x87][0x15]Z[0xeb]W[[0x1c]&[0xa1][0xfb][0xa7]c[0xb6]2[0xa3]"S[0xe8][0xa3][0xd7][0xda][0x9a]Ar[0xd2]jSY[0x9d][0x97][0xc7]rv[0xb8][0x1d][0xf][0xfb][0xde][0x95][0x1b][0xea][0x13]jK[0x8b][0x17][0xf2][0xad][0x8f][[0xb2]2_[0xfe][0xb9][0x83][0xd7][0xfd][0xe3][0xc7][0xa6]j[0x9b][0xdb]K[0xa9][0xa9][0x17][0xe9][0xb2][0xd8][0xff][0x0][0xcb][0xa6]~[0xf7][0xfd]t#[0xaf][0xfb][0xa3][0x8f]Ri[0xde]T[0xf6]<[0xdb][0xfe][0xfa][0x1][0xff][0x0],I[0xf9][0x97][0xfd][0xda]v[0x15][0xc9]-[0xf4][0xe1][0xa5][0xa6]4[0xc0][0x11]3[0xb9][0xe2]s[0x90][0xe4][0xf5]$[0xfa][0x9f]ZV[0xd6][0x91][0x9b][0xec][0xf1]D[0xcf]zF~[0xcc]N[0xd2][0xa3][0xfb][0xcc]{/[0xbf]~[0xc2][0xaa]&[0xb0]uE+[0xa6]0[0x8][0xa7]l[0x97][0xc]2[0x10][0xf7][\n]"
10:18:29.898 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "?[0x89][0xbf]A[0xef][0xd2][0x93][0xfb]:[0x8][0xc1]h[0xcb][0xac][0xec]w4[0xfb][0xb3]#[0x1f]V=[0xff][0x0][0xa7]lQ`[0xb9]a[0xb4][0xf8][0xe5]q5[0xf3][0x8b][0x8b][0x9c][0x10][0xae][0x6][0xd5][0x88][0x1e][0xa1][0x7]ory=[0xfd])[0xb3][0xdf][0xbe][0x95][0xb][0xcb]s'[0x99]j[0x83]&C[0xf7][0x90]{[0xfa][0xd5];[0xad]U[0xf4][0xf6]Hn[0x97][0xcd][0x92]^"1[0xf5][0xa8][0xec]=I[0xe2][0x91]!2[0xba][0xcf]t[0xcb]+[0xa9][0xcc]j[0xbf]r?q[0xea][0xda]?[0x86])[0xd8]W[0xee]XG}]D[0x93][0xe5],[0xcf]+o[0x9e]d[0xff][0x0][0xae][0x9e][0x83][0xfd][0x8f][0xcf][0xd2][0xac]Mk[0x1c][0x8c][0x1e]2a[0x94][0xe][0x19]8[0xfc][0xc5]e[0xcd][0x10][0xb7][0xdd]42[0x8b]}[0xa3]-[0x9f][0xb9][0xf8][0xfa]T[0x16][0xfa][0x84][0x9a][0x99][0xd9]8kX[0xe7][0x9f]*[0xd3][0x8f]\[0xf5][0xb][0xed][0xd4][0xd1]`;kMf[0xeb]Y[0x93][0xec][0xec][0x1b]K[0x8b][0xb4][0xcc]0[0xf7][0x3][0xd6]<[0x8f][0x95][0xda]9'[0xb5]l[\r][0x1e][0xc5]m[0xbe][0xca]-[0x94]G[0x92]s[0xce][0xec][0x9e][0xac][[0xa9]>[0xe6][0xac][0xdc][0xda][0xc3]v[0x9e]\[0xf1][0x87][0x1d][0xb3][0xd4]}[\r]s[0x93][0xea]:[0x85][0xac][0xad]o[0xa5][0xa7][0xda][0xc6]v[0xcd]r[0xe3]r[0xdb]{[0xf][0xf9][0xe8]G[0xa0]8[0x1d][0xc8][0xe9]X[0x1a][0x96]oo[0xe6][0xf0][0xe4]hdw[0xbd][0x81][0xce][0xd8][0xe1]Q[0xba]r}[0x14][0x17][0xf9][0xe9]R[0xdb]+[0xeb][0xb1][0x9][0xae][0xa5][0x9]lG[0xfc]y[0xc2][0xfc][0xff][0x0][0xdb]V[0x1c][0x9f][0xa0][0xc0][0xfa][0xd4][0xfa]][0xbd][0x99]V[0xb9][0x86]Ss;[0x8c]Iq)[0xcc][0x87][0xd8][0xff][0x0]t{[0xc][\n]"
10:18:29.898 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "/la[0x8c]=[0xe2]N[0xb6]N[0x83]-6p[0xbf][0xf0].[0xdf][0xe7][0xbd][0x0][0x12][0xe9]1[0x6][0x13]Y[0x1f][0xb2]L[0xa3][0x0][0xc6]0[0xa7][0xd8][0x8a][0xa3]q[0xe2][0x1f][0xb1]]&[0x9f]y[0x1]k[0xf9][0x6]cH[0x88][0xda][0xe3][0xfb][0xc4][0x9e][0x10]{[0x9f][0xc0]v[0xa8]m[0xf5][0x9b][0xdb][0xf9][0x8d][0xb4][0xc0][0xe9][0xb0][\r][0xdb]![\r]p=c[0x7][0xee][0xf]v[0xe7][0xd0][0xe][0xb5][0xb3][0x1e][0x97]e[0x14][\r][0x2][[0xa9]G;[0x9c][0xb7][0xcc][0xce][0xbc]X[0xf2]O[0xbd][0x0]g[0xcd][0xa3][\r]Q[0x7][0xf6][0xc9]K[0x84][0xce]E[0xaa]q[\n]"
10:18:29.898 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "[0x9e][0xc4][0xf7]r=O[0x1e][0x83][0xbd]![0x82][0xf3]M[0xff][0x0]PM[0xdd][0xb0][0xff][0x0][0x96]L~u[0x1e][0xc7][0xbf][0xf9][0xe2][0x9b]4[0x9e][0x1f][0x87][0xcf][0xf3]L[0xd6][0xa0][0xe0]B[0xdc][0xc8]O[0xa2][0x1][0xcb][0x1f]a[0xf9]TV[0xf2][0xdc]k[0xd1]y[0x86]F[0xb3][0xb5]=`F[0xfd][0xfb]{9[0x1f]p{/>[0xe3][0x91]T![0xa3]^[0x86][0xf5][0x9e]-5[\r][0xdd][0xc2]q"[0xe7]j[0xc2][0xdb]n[0xc7][0xd8]d[0xfd]:[0xd5][0x9][0xf4][0x3]=[0xca][0xea][0x13][0xcf][0xbe][0xfd]9FU[0xc4]I[0xf4]_[0xfd][0x98][0xe4][0xd6][0x9c][0x9a]%[0xbc]J[\r][0x92][0x8b]9[0x10]|[0xa6]![0x80]~[0xa3][0xbf][0xd7][0xf3][0xcd]R[0x9f][M>h[0xed]5[0x4]"[0xea]Q[0xfb][0x94][0x88]g[0xce][0xfa]z{[0x93][0xc0][0xa6][0x84]0[0xdf][0xb4][0xe]"[0xbe][0x8f][0xc9][0x90][0xf4][0x90]r[0x8f][0xf8][0xf6][0xa8][0xa7][0xbe][[0xad][0xd0]Z[0xc2][0xb7]D[0x1c]31[0xc4]H}[0xdb][0xb9][0xf6]^~[0x95]5[0xde][0x9b]6[0xa5][0x19]]Gj#[0xe5][0xd6]&[0xce][0xdf]~[0xff][0x0]A[0x81][0xf5][0xaa]k[0xc][0xba]J[0x4][0x8d]L[0xb6]H0[0x10][0xf][0x9a]![0xed][0xed][0xfe]x[0xaa][0x17][0xa1]R;)[0xb4][0xd9]E[0xc5][0xc3][0xb6][0xa3][0x18][0xe4][0x6][0x1f][0xea]?[0xdc]^[0x98][0xf7][0xeb][p[0xdd]Gq[0x18][0x96])7[0xa9][0xe7]=[0xc7][0xd6][0xa8][0xc9][0xa9][0xdb])Q[0x11]7[0x12][0xb7][0xdd][0x8a].[[0xf1][0xfe][0xe8][0xf7]8[0xaa][0x12][0xe9]3[0xdc]K[0xf6][0xb6]t[0x8d][0xbb][0xd9][0xa1][0xfd][0xd3][0x8f][0xf6][0xcf][0xf1][0x1f][0xc8]:[0x4]O9[0x96]iK[0xe8]J[0x1e]`q#[0xb7][0x16][0xfe][0xe3]?[0xc4]}[0x87][0xe2]E\[0xd3][0xc5][0xbc][0xb2][0x87][0xbc]-%[0xfc][0xc3]8[0xc0]C[0xdf]b[0xf4][0x3][0xf5][0xf7][0xa7][0xd9]j[0x11]J[0xbe]Q_"H[0xc6][0xc]G[0x8d][0xa3][0xdb][0xda][0xb0][0xb5][0xbf][0x11][0xd8]<Lc[0x1e]a[0x8c][0xfc][0xb3][0x3][0x82][0x8][0xeb][0x83][0xde][0xa2]RQ[0xdc][0xa4][0xae]t:[0xa9][0xb6]xL[0x93]g[0xcc]A[0x95]u?0[0xfc]k[0xc4][0xbc]_;\[0xea][0xef]+[0xfd][0xe2]:[0xe3][0x4][0xfd]k[0xa4][0xd4]|e-[0xc2][0xa9]yp[0x87][0xa2][0xaf];G[0xa9][0xf5]5[0xc2][0xdf][0xdd]}[0xae][0xe9][0xe5][0xc6][0x1]<V[0x1c][0xee]Ob[0xda]I[0x10][0x3][0xcd]z[0x9f][0xc3]]9[0xec]4[0xd9][0xb5][0xb2]b[0x0][0x9c][0x1f]7[0xe5][0x1b]G[0xfb]U[0xe5]Y[0xed]^[0xcb][0xf0][0xc2][0xea][0xc2][0xfb]OH&[0x2]K[0x8b]c[0xf2]$[0x87]*[0xbe][0xea][0xbd]3[0xef][0xd6][0xaa];[0x99][0x9d]][0x96][0xaf]6[0xba][0x84]Y)[0xb2][0x8c]}[0xe9]'_[0xde][0x9f][0xf7]S[0xb0][0xff][0x0]i[0xbf]/[##[0xb2]B[0xd2][0xa0]qt[0xd8][0xdd]v[2[0xb6]:e[0xbb][0x8f]n[0x83][0xb6]*{[0xdb][0x1b]yA[0xb8][0x91][0xfc][0x87][0x8c]n[0xfb]#m[0xa5]~[0xa7][0xd3][0xeb]X[0xf1][0xeb]w[0xd3]H-[0xc0][0x11][[0x13][0x85][0xd4][0xde]3[0xb5][0xff][0x0][0xdc]S[0xd4][0xff][0x0][0xb4]x[0xf6]5[0xa8][0xcb]7z[0xe1][0xd0][0xfc][0xb8][0xb5][0x10]f2[0x9d][0xb0]4[0x3]/![0xf4][0xdb][0xfd]x[0x15]*XI[0xa9][0xed][0x9f]Rdxs[0xba];8[0xdb]tC[0xd0][0xb9][0xff][0x0][0x96][0x87][0xff][0x0][0x1d][0x1e][0x9d][0xea][0xcd][0xbd][0x85][0xb4][0x1][0x99]W[0xcd]yF$[0x9a]S[0xbd][0xe4][0x1e][0xe4][0xf6][0xf6][0x1c]U[0xb][0xf6][0xfe][0xc4][0x2][6,\[0xfc][0xb6] ni[0x8f][0xa2][0xe][0xb9][0xf7][0xe8];[0x9a][0x0][0xb3]>[0x9e][0xd6][0xa5][0xee]l[0xa4]Xp7<nv[0xc0]z[0xfa][0x9e][0x95]B[0xd3]Y[0x9b]Yc[0x1d][0xa2][0xb]0?[0xe5][0xac][0xeb][0x96][0x93][0xde]5[0xe3]#[0xd1][0x8f]^[0xc2][0xa4][0xb3]c[0xad][0x1d][0xfa][0x88][0x9][0xb0][0xe7][0xfb];[0xf8]P[0x8e][0xef][0xfd][0xf3][0xff][0x0][0x8e][0x8f]C[0xd6][0xb4]/`[0xb7][0xb9][0x8c][0x99][0xf0][0xa1][0x6]D[0x99][0xc1]O|[0xd3][0x2][0x98][0xd1][0xad][0x17]{H[0xad]4[0xce]0[0xd3][0xca][0xd9][0x90][0xfe]=[0x87][0xb0][0xc0][0xf6][0xaa][0xd7]Z[0x9f][0xf6][0x2]![0xbb]v[0xb9][0x81][0xce][0xd8][0xf6][0xc][0xcc]O`[0x17][0xf8][0xbf][0xcf]"[0xa9][0x8d]V[0xfa]I6+[0x11][0xa7][0xe7][0x9][0xa9]2d[0xc9][0xfe][0xea][0x9e][0xdf][0xed][0x1c][0x83][0xd8][0x1e][0xb5][0xa3]om[0x4][0x4][0xc8][0x9f][0xbc]w[0x1c][0xcc][0xed][0xbd][0x98][0xbc]{{t[0xa6]+[0x80][0x86]mM[0x4][0xb7]2[0x8]m[0x9c]em[0xe1]|[0x96][0x1f][0xed][0xb8][0xff][0x0][0xd0]W[0x1e][0xe4][0xd4]R[0xd8][0x8][0x8]m<-[0xbb]([0xc0][0x8d]F[0x11][0x87][0xa6]*[0xad][0xfc][0xe3]I[0xcc][0xd6][0xf2][0x5]-[0xff][0x0].[0xdd]|[0xd3][0xe8][0xaa]9[0xcf][0xf9][0xe0]T[0x16][0xf7][0xd2][0xea][0xea]|[0xf2][0xd6][0x91][0xf4]kU8[0x93][0xfe][0x6][0xc3][0xa7][0xd1][0x13][0xda][0x9d][0x80][0x99]5[0xe3]q4[0x96]V[0xd1][0x6][0xbc][0x8b][0x89]C[0x9f][0xdd][0xc4]}[0xc8][0xeb][0xfe][0xe8][0xe7][0xe9]H[0xda]tr[0x93]%[0xd1]73[0x91][0x8f]1[0xc6]6[0xfb] [0x1c]([0xfa]s[0xea]MY[0xfb]%[0xb4][0x91]$K[0x12][0xc4][0xa9][0xf7]<[0xb1][0xb7]o[0xd2][0xb3].u9,[0xee][0x5][0xa6][0xd1]t[0xe7][0x8f]9N[0x16]/[0xfa][0xe8]{}[0x6]I[0xa6]/A..[G[0x88][0xcb]p[0xfb][0xed][0x17][0xf8][0xcf][0xde]OA[0xef]H[0xc][0xba][0xa2][0x7][0x94][0x98]m[0x18]q[\n]"
10:18:29.898 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "[0x9c]<[0x83][0xfd][0xb2]:[0xf][0xf6]G>[0xa7][0xb5]Z[0x8e][0xcd]K-[0xc5][0xc4][0x82][0xe6]\eX[0x8f][0x91]?[0xdc]^[0xdf]^O[0xbd]T[0x9e]$[0xb3]W[0xb8][0x8a]e[0xb7][0x3][0xef][0x6][0xfb][0x8d][0xed][0x8f]_[0xa5]1z[0x12]=[0x9a][\r][0xad]m[0x8b]y[0x14]av[0xc][0xc]zb[0xa9][0x8d]^Yn[0x1a][0xc9][0x4]i2[0x1c]=[0xc3]s[0x12][0xfb][0xf][0xef]7[0xb7]A[0xdf][0xd2][0xa2][0x86][0xf6]]L[0x94][0x99]^[0xc9]?[0xe7][0x89][0xf9]d[0x93][0xdf]?[0xc2]=[0xba][0xfa][0xe3][0xa5]Xu[0x8b][0xca][0x10][0xf9]j#_[0xba][0x80]`[0xf][0xa5];\D[0xa9]m[0xc][0xb]!9[0x96]G[0xff][0x0]Y$[0x9c][0xb3][0xfd]}[0xbd][0x87][0x2][0xb3]n'6[0x3]t[0x4][0xb6][0xe3][0xf2][0xdb][0xf5].[0xd9][0xaa][0xb3]_\B[0xe6][0x1b]?[0xf4][0x88][0xc7][0xe][[0x91][0x17][0xe3][0xdc][0xfb]*t[0xc][0x84][0xb4][0x8a][0xc6]Gn[0x19][0xdb][0xef][0x1f]oa[0xec]8[0xaa][0xb5][0xc4]Ko2[0xde][0xb8][0x9a][0xe8][0x86]u9[[0xe1][0x88][0xfa][0x9f][0xef]7[0xbf]n[0xd5]b[0xe0]$[0xca]L[0xb8][0xc0][0xe7]$[0xe3][0x1e][0xf9][0xaa]7-[0x0][0x0][0xb9]a![0xe1]6[0xc][0xb9]>[0xc3][0xbd]W[\r]q[0xc7][0xf6][0x88][0xf9]s[0xf2]*[0xf2][0xa3][0xfd][0xef]S[0xfa]:~#zG[0xd9][0xb5]i[0xe][0xe9][0x92][0xe3][0xfb][0x17][0xb5][0xab][0x1d][0xb7],=_[0x1c][0xaa][0xff][0x0][0xb0]9[0xf5][0xc7]J[0xe8][0xac][0xe6][0xb6][0x96][0xdd][0x5][0xa6][0xc1][0x12][0x0][0xaa][0x88]6[0xec][0xf6][0xc7]j[0xb1]mu[0x5][0xdc]~d2[0x6]P2{[0x15][0xfa][0xfa]V[\r][0xf5][0xbc][0xfa][0xcc][0xa5][0xf4])~[0xc5][0x83][0xf3][0xea] |[0xaf][0xea][0xa8][0xbf][0xc5][0xee][0xdd][0x7][0xb9][0xae]3quU[0x86]+[0x8c]X[0x7]:[0xab][\r][0xcb][0x14][0x18][0xe4]z[0xc9][0xd9]W[0xdc][0xfe]G[0x81]P[0xd8][0xac][0x8d]:[0x1f][0x11]mk[0xd5]9[0x8d][0xe5][0xd9]=[0xd0]w?[0xed][0x1e]~[0x95]{M[0x92][\r];[0xfd][0xe]x>[0xc9]3[0x1d][0xcd]#[0x1c][0x89][0x8f][0xf7][0x8b][0x9e]I>[0xa4][0xff][0x0][0x85]_[0xd4]f[0xb2][0x82][0xd8][0x9b][0xd2][0xa2]68U#%[0x9b][0xb0]P9'[0xe9][0xcd][0x3][0x1d]4[0x11][0xdc][0xc6]c[0x95][0x4][0x8a][0xdd][0x88][0xcd]ss[0xdd][0xdf]YJ[0xd0]hK[0xfd][0xa1][0x12][0x1c]J\[0x13][0x1d][0xb7][0xd1][0x87][0xdf]?[0xec][0x8f][0xc7][0x1d]hkM[[0x99]2L[0xba]7[0xfc][0xf8][0x87][0xfd][0xfe]=\[0x8e][0x8b][0xfe][0xc8]?Z[0xe8]lf[0xb5][0x96][0xd9][0x5][0xa6][0xc5][0x89][0x6][0x2] [0xc6][0xcf]lv[0xa0]E[0x1d]2[0xd6][0xd2]_[0xf4][0xc1]3][0xdd][0x11][0x86][0x9e]_[0xbe][0x99][0xec][0x17][0xa2][0xf]a[0xf9][0x9a]/[0xb4][0xd8][0x89]k[0xa8][0xe4][0xfb],[0xc8][0x9]3[0x3][0x81][0xff][0x0][0x2][0xf6][0xa8][0xf5][0x8f]"[0xde]P[0xd6][0xa5][0xff][0x0][0xb4][0xd8][0x13][0x14]0[0xc][0xb4][0x9f][0xef][0xe][0x81]}X[0xf1][0xf5][0xe9]T[0xec][0xd6]}Ba[0x1e][0xbf][0xb5]n[0x94][0xe5]l[0xd7][0xfe]=[0xc7][0xa1][0xff][0x0][0xa6][0x87][0xdc][0xf1][0xe8]([0x2][0x94]:[0xed][0xde][0xa1]7[0xd9][0x11]R[0xd4][\r][0xf3][0xa1])0[0xf5][0x89]O_[0xa9][0xe2][0xb4]SH[0xb4]H[0xa4]F[0x8c][0xca][0xd2][0xf3]$[0xb2][0x9d][0xd2]9[0xf5]-[0xfe][0x1c][0xe][0xc2][0xaf]^YGy[0x19][0x8e]d[0xdc][0xa7][0xa7][0xa8][0xfa]V[\r][0xc6][0xa9]>[0x95]q[0xf6][0x4]C[0xce]<[0xdc][0xe1]m[0xfd]<[0xd6][0xe7][0x1f]A[0x96]5B[0x12][0xf2]i48[0x9a]K[0x99][0x4][0x96][0xb][0xc7][0x9a][0xc7][0xe6][0x8b][0xd0][0x1f]QT[0xcd][0xe4][0xfa][0x84]bKbm[0xad][0x9b][0x95][0x95][0x97][0xf7][0x8e]?[0xd9]S[0xf7]~[0xad][0xcf][0xb0][0xef][0xb9][0x16][0x90][0xb3]2[0xdc][0xdd][0xcc]/%[0xc6]Q[0xb1][0xfb][0xb4][0xcf][0xf7][0x17][0xa0][0xfa][0x9c][0x9f]~[0xc2][0xa4][0xfa],[0x96][0xce][0xd2][0xd8][0x8c][0x83][0xcb]#z7[0xd3][0xdf][0xfc][0xfb]U[0xa6]&[0xbb][0x1c][0xfc]ZY[0xb1]v[0x93]M][0xa5][0x8e]dG9[0xf3]O[0xa9]'[0xbf][0xf9][0xe2][0xa7]]N[0x5]S[0xe7]1[0x86]#pb`K[0x13][0xe8][0x7]S[0xf8]U[0xfb];[0xe4][0xd4][0xc3][0xc5][0xa4][0xa2][0xc8][0xf1][0x9d][0xb3]K/[0x11][0xc4]}8[0xe5][0xcf][0xd3][0x8f]R*[0x9e][0xb7]e[0xa6]i[0x8]/[0xef][0xee][0xcf][0xdb][0xc2][0x9f].[0xe9][0xf0][0x8][0xc0][0xfb][0xaa][0x7][\n]"
10:18:29.898 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "[0xbe][0xc3][0xf1]'[0xbb][0xb8][0xb9]L[0xdd]p[0xbc][0xb6][0x12]]][0xff][0x0][0xa0][0xc1][0x10][0xc8][0x1c]y[0xaf][0xe8][0x9][0xe8][0xa0][0xfa]r~[0x9d]+[0xcb]/[0xb5]C4[0xac][0xcd][0xca]tT'[0x85][0x1e][0xd5]{[0xc5]>/[0xb8][0xd7][0xde]4`[0xb1][0xc5][0x8][0xc2][0xaa][0x8c][0x6]=[0xd8][0xd7]0[0xce]X[0xe4][0x9a][0xe6][0x9d][0xa4][0xcb]N[0xc8][0x9a]y[0xcc][0x8d][0x91][0xc0][0xf4][0x15][0x6]i[0xa4][0xd1]RM[0xc7]f[0xb5][0xfc]=[0xab][0xcd][0xa4][0xea]1O[0x13][0x95][0xf9][0x80]>[0xf5][0x8e])[0xca][0xc5]H"[0x98][0x8f][0xa2]t[0x9b][0x85][0xd4][0x4]SkO[0xe6][0xbb][0x10][0xd0][0x3][0xc5][0xba][0xfa]`t-[0xee]J[0xe8][0xe6]H[0xdd][0x18]J[0x14][0xa6]>`[0xdd]1^c[0xe0]/[0x13][0xb][0xab][0xf][0xec][0xdb][0xa8][0x9e][0xe9][0x82][0xfe][0xee]4[0x19]f[0xf6][0x1e][0x9f]\[0xf1]]B[0xd9]_[0xdb][0xbf][0x99][0xa9][0xb7][0xda]l3[0x94][0xb3][0x8c][0xe5]`[0xe7][0x82][0xc7][0xfe]Z[0xe8]#[0xb5]j[0xb5]CB[0xc9]=[0xf2]1[0x1a][\n]"
10:18:29.898 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "[0x99][0xad]2|[0xc9][0xa5][0x19]D[0xf5][0xf2][0x87]W=[0xd9][0xf5]&[0xb5][0xb4][0xb8][0xac][0xf6]5[0xc4][0xe][0xd3]L[0xe3][0x12][0xcd])[0xcc][0xa7][0xd8][0xfa][0xf]a[0xc5]X[0x8a]x[0xe6][0x8c]<L[0x19]1[0xc1][0x1d][0xbd][0xbd][0xab][0x12][0xf1][0xde][0xfa]f}[0xf]h[0xb9]S[0x87][0xbb]o[0xf5][0x3][0xd4][0x1f][0xef][0x9f]a[0xc7][0xa9][0xaa][0x19]{W[T[0xb]+[0xb3][0xa5][0xce]q[0xf][0x92]3#[0x9f]#[0xa3][0xef]OQYP[0x1b][0xab][0x99]U<#[0xa2]1[0xc1][0x86][0xdd]Nboy[0xf]Foo[0xba]=[0xfa][0xd5][0xed]-[0xa3][0x8a]FK[0x80][0xdf][0xda][0x4]bYe[0xe5][0xa4][0xff][0x0]t[0xf4][0xb][0xfe][0xc8][0xe3][0xeb]V5[0x1b][0x9b]H[0xe1][0x9]t7[0xf9][0x87][0x9][0x12][0xae][0xe7][0x90][0xfa]([0x1c][0x93][0xfe]M1[0xb]8[0xc][0xac][0x1c][0x2][0xb8][0xf9][0xb7]t[0xc7][0xbd]r[0xd2][0xbd][0xef][0x98][I[0xdd][0xf6][0x1c][0xe6]I[0x8][0xc9]>[0xbe]P=[0xde][0xe9][0xe9][0x9e][0xd7][0x16][0xda][0xf6]&[0xdd][0xa9][0x82][0xfa]vs[0x1d][0xb0]m[0xc6]?O4[0x8f][0xbd][0xf4][0x1f]([0xf7]5[0xb4][0x1a]9b[0x12]!R[0x98][0xea]:[0x1]LF[0x15][0xa9][0xb7]E2[0xdb][0x82][0xf2]7[0xdf][0x91][0xce][0xe9][0xf][0xd4][0x9f][0xff][0x0]W[0xa5]U[0xbe]h[0x15][0x96]I$0[0xcc]~[0xe1]#K[0xb7][0xb0][0x3][0x93]Rj[0x11]I[0xa9][0xb7][0x99][0xa5]7[0x91][0x83][0xf3]^[0xe3][0xe5]P[0x8b][0xfc]_[0xef][0x1e]>[0xb5]V[0x12][0xb6][0xcc][0xd1]<~T[0xc7][0xab][0xb3]n2{[0xee]=j[0xd1];[0x4]Wws[0xb7][0x97][0xa8][0xb3]Y[0xa1][0xfb][0xa8][0x87][0x6]A[0xfe][0xd3][0xe][0x9f]A[0xf9][0xd6][0x92]<q[0xc6] [0x8e]4X[0xff][0x0][0xb8][0xab][0xc5]f\][0xc4][0x83][0xcb][0x97][0xe7]c[0xd2] 2[0xc7][0xe8]?[0xad]g[0x91]t[0x1f]%[0x99]m;[0xdb]+[0xfc][0xe7][0xea][0xde][0x9e][0xc3][0xf1][0xa7]a[0x17][0xe7][0xb9][0x9a][0xd6]FM0}[0xa2]#~h[0x9][0xfd][0xda]{[0x96][0xed][0xf4][0xeb]R[0xda]<s[0xc8][0xb2][0xcc][0xe6]k[0x95][0xec][0xe3][0x1e]_[0xae][0xd5][0xed][0xf5][0xeb]Iks[0x1][0x89]V[0x1c]*[0xf][0xe0][0x3][0x1b][\n]"
10:18:29.898 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "[0xab]y<S[0x92][0xb6][0xe8]d[0x99]x[0xf3][0x14][0xe0]![0xf7]o[0xe8]9[0xfa]S[0xb0]\[0xb9][0xa8][0x98]<[0xa2][0xd3][0x95][\n]"
10:18:29.899 [main] DEBUG org.apache.http.wire - http-outgoing-0 << ":1<[0x8f][0xa5]a[0xcb]-[0xd3][0x92][0xb3][0xf9][0x8b]g[0xd8][0xf4][0x91][0x87][0xfb]^[0x83][0xf5][0xfa]U[0x88][0x8c][0x96][0xec][0x1e][0xfd][0xcc][0xf2][0xff][0x0][0xc][0xf8][0xf9]G[0xb0][0x1f][0xc3][0xfc][0xea]Y[0xe6][0x8d][0x13]{8[0xda]z[0x1e][0xb9][0xfa]z[0xd5]XC#x[0xc4]ab[\n]"
10:18:29.899 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "[0x10]p[0xa1]x[0x2][0xa9][0xce]|[0xd6]"[0xcf][0x2]q[0xc1][0x93][0xf8][0x17][0xeb][0xeb][0xf4][0x15][0x14][0x96][0xb3][0xcd]'[0x99][0x1e]m[0xe3][0xef][0x1e]pd[0xfa][0xe3][0xee][0x8f][0xf3][0xc5]X[0x8a]U[0x18][0x8b]o[0x94][0xc3][0x80][0x9d][0xbf][\n]"
10:18:29.899 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "7[0x11][0x1d][0xbb]-[0xbb]bp|[0xf2]0eo[0xe2][0xfa]z[0xf]j[0xb3]-[0xc2]*[0xe1][0xf9][0xdc]8Q[0xc9]o[0xa0][0xaa][0xef]/[0x9e]Z(TI[0xd9][0x9d][0xbe][0xe2][0xff][0x0][0x89][0xf6][0x1f][0xa5]2+I,[0x1]e&p[0xdf]y[0x9b][0xef][0xfe][0x1e][0xde][0xd4][0x1][0xeb]w[0x9e][0x17][0xba][0xd5][0xa4][0x17][0x17]W[0x11]Z[0xb2][0x9d][0xdf]f[0xb5][0x7][0xcb][0x93][0xda]F<[0xb8][0xf6][0x0][0x3][0x9e]A[0xad];m#[0xc6][0xcb]k}[0x12][0xdb]J[0x6][0x14][0x8e]#a[0xec]{[0x9f][0xa5]Q[0xb8][0xf1]/[0xf6]5[0xca][0xd8][0xdf][0xa1][0xba][0x9d][0xb8][0x8c][0xdb][0x0][0xcc][0xde][0x1f][0xc3][0xef][0x9c]}[\r]Z[0xb9][0xb1][0xbf][0xd6][0xad][0xcc]wREem [0xfb][0xb6][0xe4]I.=D[0x84]a~[0xa0]~[0x15][0xc4]t[0x89][0xaa][0xdc][0xc5]36[0x9f][0x5][0xb2][0xdf]][0xe3]&2[0xdb]R[0x1c][0xff][0x0][0x14][0x8d][0xfc]?A[0xf3][0x1e][0xc2][0xb3][0xac]t[0x8b][0x8d][0x6]Suq+j[0x99][0x18]2[0xb2][0xe1][0xa0][0x1d][0xd5][0x7][0xf0][0xa7][0xeb][0xea]j[0xe5][0xa5][0x93][0xf8]b[0xdc][[0xc1][0x19][0x9b]ORO[0x1f]}3[0xd4][0x93][0xdf][0xea]J[0xbf].[0xa9]e[0x14][0xb]pg[0xc][0x1d][0xb6][0xa2] [0xdd]#[0xb7][0xf7]B[0x8e]I[0xf6][0xa0]C[0xa1][0xb8][0x86]x[0xbc][0xd8][0xa4][0x5][0x7]$[0xe7][0x1b]~[0xbe][0x95][0xce][0xde][0xc3]u[0xaa][0xca]e[0xf0][0xf3][0x8b]B[0xf][0xcf]|[0xcb][0xfb][0xb9]=U[0x17][0xf8][0x8f][0xfb]_w[0xea]jK[0x9f][0xe][0xde][0xea]3[0xb][0xe7][0xdb]j[0xa3][0x91][0xa6][0xab]f9[0xeb][0xa9][0x1c]1[0xff][0x0]g[0xee][0x8f][0xaf]5[0xb5]e}[0x1d][0xce]ad[0xf2]n#[0x18]h[[0x82]1[0xe9][0xed]#[0x14]4o[0xb3][0xc1][0xbe][0xdc][0xc2]a[0xbc]'3[0x19][0xe][0xe7][0x94][0xff][0x0]x[0xb1][0xe5][0xbf][0xa7]n*[0xc6][0xad][0x15][0x93]Z3[0xdf]2G[0x12][0xcb]RpT[0xfb]{[0xfb]w[0xa8]u[0x99]![0x9d][0xbe][0xc9]o[0x13]\[0xea]*7"[0xc6][0xdb]|[0x9f]Fv[0xfe][0x15][0xfa][0xf2]{[\n]"
10:18:29.899 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "[0xa3][0xa7][0xc5]=[0xad][0xd2][0x1f][0x10]J[0xb7][0x17][0xa3][0xfd]M[0xc6]1[\n]"
10:18:29.899 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "[0xff][0x0][0xb8][0xa7][0xee][0x9f][0xf6][0x8f]>[0xb8][0xe2][0x80]([0xc5]q[0xa9][0xcb]([0xb7][0xd4][0xc][0xf6]zcq[0x15][0xc0]][0xb3][0xcc]?[0xda][0xef][0x18][0xff][0x0][0xc7][0xbf][\n]"
10:18:29.899 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "[0xe8]![0xb3][0xb6][0xb7][0xb6][0x16][0xf0]E[0x1a][0xc1][0x8e][0x11]G[0xca]s[0xdf][0xdf]>[0xbd][0xea][0xdc][0xd0][0xac][0xa8][0xd1][0xc8][0xa1][0xd5][0x87]*GZ[0xe5][0xa5][0xbd][0xbe][0xb5][0x98][0xc3][0xa3][0x8f][0xb4][0xd8][0x6]"k[0xa7][0x1b][0x92][0xdc][0xe7][0x90][0x9f][0xdf]?[0xa0][0xee]sL[0x9]5)[0xff][0x0][0xe1][0x1d][0x2]hKM[0x14][0x8d][0xc5][0x9a][0xfc][0xd2]1[0xff][0x0]`u?[0xd3][0xbd]-[0xba][0xc9][0xae]D&[0xb9]&[0xd8][0xf3][0xf6]8[0xdb][\r][0xf4][0x95][0x87][0xfe][0x82][0xbc]{[0x9a][0xd4][0xd3][0xac][0xad]cSs[0xb][0xb5][0xc4][0xd2][0x8f][0x9e][0xe6]C[0x99][0x1b][0xd8][0xff][0x0]t[0xb2]0[0x7][0xa5]s[0x1f][0x10]o[0xaf]|9`5-"[0x5]II"i[0x98][0xfc][0x8a];|[0xbd][0xd8][0x9f][0xc3][0xf1][0xa7]p0|m[0xe3]=?[0xc3]w[0xa9]k[0xa6][0xc0][0xa6][0xfa]%[0xc3][0x18][0xc8]T[0x8c]vR[0x7][0xb7]j[0xf3][0x1f][0x10][0xf8][0xbb]S[0xf1][0x19]A{(d[0x8c][0x92][0x8a][0xa3][0x0]VM[0xdd][0xdc][0xd7]s[0xc9]<[0xf2][0xb4][0xb2][0xc8][0xc5][0x9d][0xd8][0xe4][0x92]z[0x9a][0xac]Nk7!\S[0xea]i[0xa4][0xd0]i*I[\n]"
......
I couldn't post the full response as its to too large.
I have tried the following but it appears to be null:
HttpEntity httpEntity = httpResponse.getEntity();
String jsonResponse = EntityUtils.toString(httpEntity, StandardCharsets.UTF_8.name());
byte[] imageBytes = org.apache.commons.codec.binary.Base64.decodeBase64(jsonResponse);
BufferedImage img = ImageIO.read(new ByteArrayInputStream(imageBytes));
Is the response a json String or is it just the jpeg bytes? If it's bytes then you shouldn't use a string.
My guess is something like:
HttpEntity httpEntity = httpResponse.getEntity();
BufferedImage img = ImageIO.read(httpEntity.getContent());

How to Create new project in Rally using RallyRestApi

In the following code I am trying to create a new project using RallyRestApi,
RallyMain {
public static void main(String[] a) {
BasicConfigurator.configure();
try {
RallyRestApi restApi = new RallyRestApi(new URI(
"https://rally1.rallydev.com"), "_APIKey");
restApi.setApplicationName("RallyRestExample");
restApi.setWsapiVersion("v2.0");
JsonObject newProject = new JsonObject();
newProject.addProperty("Name", "Sample Project One");
newProject.addProperty("Description", "Sample project for testing API");
//newProject.addProperty("Owner", "nmuthusamy");
newProject.addProperty("Workspace", "/workspace/Workspace 1");
CreateRequest createRequest = new CreateRequest("Project", newProject);
CreateResponse createResponse = restApi.create(createRequest);
System.out.println("Response "+createResponse.wasSuccessful());
} catch (Exception e) {
System.out.println("Exception \n"+e);
}
}
}
When I run the above code new project was not created on the Rally workspace.System.out.println("Response "+createResponse.wasSuccessful()); always prints false. Here ScreenShot of my rally workspace I have also attached the screen of my Workspace
I have even followed the answer given in this link Stackoverflow but it is not woking.
Following is the console log which I get when I run the main method.
0 [main] DEBUG org.apache.http.impl.conn.BasicClientConnectionManager - Get connection for route {s}->https://rally1.rallydev.com:443
15 [main] DEBUG org.apache.http.impl.conn.DefaultClientConnectionOperator - Connecting to rally1.rallydev.com:443
448 [main] DEBUG org.apache.http.client.protocol.RequestAddCookies - CookieSpec selected: default
449 [main] DEBUG org.apache.http.client.protocol.RequestAuthCache - Auth cache not set in the context
449 [main] DEBUG org.apache.http.client.protocol.RequestTargetAuthentication - Target auth state: UNCHALLENGED
450 [main] DEBUG org.apache.http.client.protocol.RequestProxyAuthentication - Proxy auth state: UNCHALLENGED
450 [main] DEBUG com.rallydev.rest.client.ApiKeyClient - Attempt 1 to execute request
450 [main] DEBUG org.apache.http.impl.conn.DefaultClientConnection - Sending request: POST /slm/webservice/v2.0/project/create.js?fetch=true HTTP/1.1
450 [main] DEBUG org.apache.http.wire - >> "POST /slm/webservice/v2.0/project/create.js?fetch=true HTTP/1.1[\r][\n]"
451 [main] DEBUG org.apache.http.wire - >> "zsessionid: _F99sUCMTR7OsOz4IpiCWp5Xl1UYRJ0wFqBpg5Wz5kFg[\r][\n]"
451 [main] DEBUG org.apache.http.wire - >> "X-RallyIntegrationLibrary: Rally Rest API for Java v2.2.1[\r][\n]"
451 [main] DEBUG org.apache.http.wire - >> "X-RallyIntegrationVersion: 2.2.1[\r][\n]"
451 [main] DEBUG org.apache.http.wire - >> "X-RallyIntegrationName: RallyRestExample[\r][\n]"
451 [main] DEBUG org.apache.http.wire - >> "X-RallyIntegrationVendor: Rally Software, Inc.[\r][\n]"
451 [main] DEBUG org.apache.http.wire - >> "Accept-Encoding: gzip,deflate[\r][\n]"
451 [main] DEBUG org.apache.http.wire - >> "Content-Length: 125[\r][\n]"
451 [main] DEBUG org.apache.http.wire - >> "Content-Type: text/plain; charset=UTF-8[\r][\n]"
451 [main] DEBUG org.apache.http.wire - >> "Host: rally1.rallydev.com[\r][\n]"
451 [main] DEBUG org.apache.http.wire - >> "Connection: Keep-Alive[\r][\n]"
451 [main] DEBUG org.apache.http.wire - >> "User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_40)[\r][\n]"
451 [main] DEBUG org.apache.http.wire - >> "[\r][\n]"
452 [main] DEBUG org.apache.http.headers - >> POST /slm/webservice/v2.0/project/create.js?fetch=true HTTP/1.1
452 [main] DEBUG org.apache.http.headers - >> zsessionid: _ApiKey
452 [main] DEBUG org.apache.http.headers - >> X-RallyIntegrationLibrary: Rally Rest API for Java v2.2.1
452 [main] DEBUG org.apache.http.headers - >> X-RallyIntegrationVersion: 2.2.1
452 [main] DEBUG org.apache.http.headers - >> X-RallyIntegrationName: RallyRestExample
452 [main] DEBUG org.apache.http.headers - >> X-RallyIntegrationVendor: Rally Software, Inc.
452 [main] DEBUG org.apache.http.headers - >> Accept-Encoding: gzip,deflate
452 [main] DEBUG org.apache.http.headers - >> Content-Length: 125
452 [main] DEBUG org.apache.http.headers - >> Content-Type: text/plain; charset=UTF-8
452 [main] DEBUG org.apache.http.headers - >> Host: rally1.rallydev.com
452 [main] DEBUG org.apache.http.headers - >> Connection: Keep-Alive
452 [main] DEBUG org.apache.http.headers - >> User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_40)
452 [main] DEBUG org.apache.http.wire - >> "{"Project":{"Name":"Sample Project One","Description":"Sample project for testing API","Workspace":"/workspace/Workspace 1"}}"
1719 [main] DEBUG org.apache.http.wire - << "HTTP/1.1 200 OK[\r][\n]"
1720 [main] DEBUG org.apache.http.wire - << "Date: Sat, 10 Jun 2017 07:59:30 GMT[\r][\n]"
1720 [main] DEBUG org.apache.http.wire - << "Content-Type: application/json; charset=utf-8[\r][\n]"
1720 [main] DEBUG org.apache.http.wire - << "Content-Length: 176[\r][\n]"
1720 [main] DEBUG org.apache.http.wire - << "Connection: keep-alive[\r][\n]"
1720 [main] DEBUG org.apache.http.wire - << "Set-Cookie: __cfduid=dc354f67bed2fd443e4bbd5081140f56d1497081569; expires=Sun, 10-Jun-18 07:59:29 GMT; path=/; domain=.rallydev.com; HttpOnly[\r][\n]"
1720 [main] DEBUG org.apache.http.wire - << "X-XSS-Protection: 1; mode=block[\r][\n]"
1720 [main] DEBUG org.apache.http.wire - << "RallyRequestID: qd-app-071j56j3qgdx7xfhnyq78y1yxw7.qd-app-075984713[\r][\n]"
1720 [main] DEBUG org.apache.http.wire - << "Expires: Thu, 01 Jan 1970 00:00:00 GMT[\r][\n]"
1720 [main] DEBUG org.apache.http.wire - << "Set-Cookie: JSESSIONID=qd-app-071j56j3qgdx7xfhnyq78y1yxw7.qd-app-07;Path=/;Secure;HttpOnly[\r][\n]"
1720 [main] DEBUG org.apache.http.wire - << "Set-Cookie: SUBBUCKETID=108;Path=/;Domain=rally1.rallydev.com;Secure;HttpOnly[\r][\n]"
1720 [main] DEBUG org.apache.http.wire - << "Set-Cookie: SUBSCRIPTIONID=122108;Path=/;Domain=rally1.rallydev.com;Secure;HttpOnly[\r][\n]"
1720 [main] DEBUG org.apache.http.wire - << "Vary: Accept-Encoding[\r][\n]"
1720 [main] DEBUG org.apache.http.wire - << "Content-Encoding: gzip[\r][\n]"
1721 [main] DEBUG org.apache.http.wire - << "P3P: CP="NON DSP COR CURa PSAa PSDa OUR NOR BUS PUR COM NAV STA"[\r][\n]"
1721 [main] DEBUG org.apache.http.wire - << "Cache-Control: private,max-age=0,must-revalidate[\r][\n]"
1721 [main] DEBUG org.apache.http.wire - << "Strict-Transport-Security: max-age=31536000; includeSubDomains; preload;[\r][\n]"
1721 [main] DEBUG org.apache.http.wire - << "Set-Cookie: SERVERID=2dd8f75e6436014e8021e4a12eb0016859253e05; path=/[\r][\n]"
1721 [main] DEBUG org.apache.http.wire - << "Server: cloudflare-nginx[\r][\n]"
1721 [main] DEBUG org.apache.http.wire - << "CF-RAY: 36cacaa1dd7c2ee7-DEL[\r][\n]"
1721 [main] DEBUG org.apache.http.wire - << "[\r][\n]"
1722 [main] DEBUG org.apache.http.impl.conn.DefaultClientConnection - Receiving response: HTTP/1.1 200 OK
1722 [main] DEBUG org.apache.http.headers - << HTTP/1.1 200 OK
1722 [main] DEBUG org.apache.http.headers - << Date: Sat, 10 Jun 2017 07:59:30 GMT
1722 [main] DEBUG org.apache.http.headers - << Content-Type: application/json; charset=utf-8
1722 [main] DEBUG org.apache.http.headers - << Content-Length: 176
1722 [main] DEBUG org.apache.http.headers - << Connection: keep-alive
1722 [main] DEBUG org.apache.http.headers - << Set-Cookie: __cfduid=dc354f67bed2fd443e4bbd5081140f56d1497081569; expires=Sun, 10-Jun-18 07:59:29 GMT; path=/; domain=.rallydev.com; HttpOnly
1722 [main] DEBUG org.apache.http.headers - << X-XSS-Protection: 1; mode=block
1722 [main] DEBUG org.apache.http.headers - << RallyRequestID: qd-app-071j56j3qgdx7xfhnyq78y1yxw7.qd-app-075984713
1722 [main] DEBUG org.apache.http.headers - << Expires: Thu, 01 Jan 1970 00:00:00 GMT
1722 [main] DEBUG org.apache.http.headers - << Set-Cookie: JSESSIONID=_jsessionid;Path=/;Secure;HttpOnly
1722 [main] DEBUG org.apache.http.headers - << Set-Cookie: SUBBUCKETID=108;Path=/;Domain=rally1.rallydev.com;Secure;HttpOnly
1722 [main] DEBUG org.apache.http.headers - << Set-Cookie: SUBSCRIPTIONID=122108;Path=/;Domain=rally1.rallydev.com;Secure;HttpOnly
1722 [main] DEBUG org.apache.http.headers - << Vary: Accept-Encoding
1723 [main] DEBUG org.apache.http.headers - << Content-Encoding: gzip
1723 [main] DEBUG org.apache.http.headers - << P3P: CP="NON DSP COR CURa PSAa PSDa OUR NOR BUS PUR COM NAV STA"
1723 [main] DEBUG org.apache.http.headers - << Cache-Control: private,max-age=0,must-revalidate
1723 [main] DEBUG org.apache.http.headers - << Strict-Transport-Security: max-age=31536000; includeSubDomains; preload;
1723 [main] DEBUG org.apache.http.headers - << Set-Cookie: SERVERID=_serverid; path=/
1723 [main] DEBUG org.apache.http.headers - << Server: cloudflare-nginx
1723 [main] DEBUG org.apache.http.headers - << CF-RAY: 36cacaa1dd7c2ee7-DEL
1736 [main] DEBUG org.apache.http.client.protocol.ResponseProcessCookies - Cookie accepted [__cfduid="_cfduid", version:0, domain:rallydev.com, path:/, expiry:Sun Jun 10 13:29:29 IST 2018]
1736 [main] DEBUG org.apache.http.client.protocol.ResponseProcessCookies - Cookie accepted [JSESSIONID="_jsessionid", version:0, domain:rally1.rallydev.com, path:/, expiry:null]
1736 [main] DEBUG org.apache.http.client.protocol.ResponseProcessCookies - Cookie accepted [SUBBUCKETID="108", version:0, domain:rally1.rallydev.com, path:/, expiry:null]
1737 [main] DEBUG org.apache.http.client.protocol.ResponseProcessCookies - Cookie accepted [SUBSCRIPTIONID="999999", version:0, domain:rally1.rallydev.com, path:/, expiry:null]
1737 [main] DEBUG org.apache.http.client.protocol.ResponseProcessCookies - Cookie accepted [SERVERID="_serverid", version:0, domain:rally1.rallydev.com, path:/, expiry:null]
1738 [main] DEBUG com.rallydev.rest.client.ApiKeyClient - Connection can be kept alive indefinitely
1750 [main] DEBUG org.apache.http.wire - << "[0x1f]"
1750 [main] DEBUG org.apache.http.wire - << "[0x8b]"
1750 [main] DEBUG org.apache.http.wire - << "[0x8]"
1750 [main] DEBUG org.apache.http.wire - << "[0x0]"
1750 [main] DEBUG org.apache.http.wire - << "[0x0][0x0][0x0][0x0][0x0][0x3]"
1750 [main] DEBUG org.apache.http.wire - << "M[0xce][0xb1][\n]"
1751 [main] DEBUG org.apache.http.wire - << "[0xc2]#[0xc][0x6][0xe0]W[0x9][0x99][0xa5][0x88]c7[0xa9][0xe][0x1d]D[0xd1][0xa1][0x83]-r[0xb6][0xb1][0xb4][0x1c]I[0xc9][0xdd][\r]R[0xfa][0xee]FEp[0x9][0xe4]#[0xf9][0x93][0x19][0xb]%[0x17][0xe9]L![0xf9][0x88]9[0xcc]xS[0xe7][0xfd]s{*[0xf]n[0x14]5[0xc2][\r][0xae][0xe0][0x8f][0x7][0xfe][0xf2][0xfa][0xcd]{U[0xd1]`[0xed][0x15][0xb]I[0xbe][0x3][0x96][0x8][0x16][0xd9][0xe5]p[0xbc][0x8f][0xd4][0xc6][0xf]<$qgUX[0xee]r[0xe0][0xe4]=6[0x96]Q9[0xe5][0x81][0xfb]oJ[0x19]a[0x8][0xb6][0x4]^[0xb8]'[0x5][0xa6][0x96]Bp[0xfa][0x84]([0xe0][0xa6][0x89],[0xa8][0xc6]l[0xc]5[0xbe][0xa5][0xba][0xd8]Kv0HR[0x1b][0xcc][0xb0]Y[0x96][0x17][0xef][0xff][0xd1]?[0xd5][0x0][0x0][0x0]"
1751 [main] DEBUG org.apache.http.impl.conn.BasicClientConnectionManager - Releasing connection org.apache.http.impl.conn.ManagedClientConnectionImpl#23986957
1751 [main] DEBUG org.apache.http.impl.conn.BasicClientConnectionManager - Connection can be kept alive indefinitely
Response false
Thanks,
Nithyananth
Check out the errors in your response. The fact that wasSuccessful returns false means there were problems with your create.
String errors = createResponse.getErrors();
System.out.println(errors[0]);
One problem is that your workspace reference is by name- they need to be by ref (which is of the format /[type]/[objectid])
newProject.addProperty("Workspace", "/workspace/12345");

HtmlUnit 400 Bad Request when additional Host header is set

I need to use a browser that can be run from Java program and allows to send a custom HTTP request directly and modify any part of the HTTP request. Therefore I chose HtmlUnit.
I tried to make a simple GET request to http://localhost and added an additional header Host:localhost. The page on my localhost home is XAMPP home. Inside the page, there is a request to other site (facebook.com). If the Host header is added, I got 400 Bad Request error. The error doesn't happen if I don't add Host header.
com.gargoylesoftware.htmlunit.ScriptException: Wrapped com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException: 400 Bad Request for http://connect.facebook.net/en_US/all.js#xfbml=1&appId=277385395761685
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:894)
at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:628)
at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:515)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:775)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:751)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:739)
at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptIfPossible(HtmlPage.java:910)
at com.gargoylesoftware.htmlunit.html.HtmlScript.executeInlineScriptIfNeeded(HtmlScript.java:307)
at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:368)
at com.gargoylesoftware.htmlunit.html.HtmlScript$2.execute(HtmlScript.java:239)
at com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:258)
at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:781)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:738)
at net.sourceforge.htmlunit.cyberneko.HTMLTagBalancer.callEndElement(HTMLTagBalancer.java:1243)
at net.sourceforge.htmlunit.cyberneko.HTMLTagBalancer.endElement(HTMLTagBalancer.java:1143)
at net.sourceforge.htmlunit.cyberneko.filters.DefaultFilter.endElement(DefaultFilter.java:226)
at net.sourceforge.htmlunit.cyberneko.filters.NamespaceBinder.endElement(NamespaceBinder.java:345)
at net.sourceforge.htmlunit.cyberneko.HTMLScanner$ContentScanner.scanEndElement(HTMLScanner.java:3154)
at net.sourceforge.htmlunit.cyberneko.HTMLScanner$ContentScanner.scan(HTMLScanner.java:2117)
at net.sourceforge.htmlunit.cyberneko.HTMLScanner.scanDocument(HTMLScanner.java:945)
at net.sourceforge.htmlunit.cyberneko.HTMLConfiguration.parse(HTMLConfiguration.java:521)
at net.sourceforge.htmlunit.cyberneko.HTMLConfiguration.parse(HTMLConfiguration.java:472)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:988)
at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:246)
at com.gargoylesoftware.htmlunit.html.HTMLParser.parseHtml(HTMLParser.java:188)
at com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:267)
at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:155)
at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:517)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:391)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:309)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:473)
In HtmlUnit, is all additional headers are applied on all request on the page (not only the first URL)?
How to fix it?
No, additional requests are not applied to other requests.
Below is a complete case, compare it with yours:
index.html:
First
test
index2.html
Second
Test case:
LogManager.getLogger("org.apache.http.wire").setLevel(Level.ALL);
final CollectingAlertHandler handler = new CollectingAlertHandler();
try (final WebClient webClient = new WebClient(BrowserVersion.CHROME)) {
WebRequest request = new WebRequest(new URL("http://localhost:8080"));
request.setAdditionalHeader("Host", "abc.com");
HtmlPage page = webClient.getPage(request);
page.getAnchors().get(0).click();
}
Output:
DEBUG 08:07:31,868 org.apache.http.wire: http-outgoing-0 >> "GET / HTTP/1.1[\r][\n]"
DEBUG 08:07:31,869 org.apache.http.wire: http-outgoing-0 >> "Host: abc.com[\r][\n]"
DEBUG 08:07:31,869 org.apache.http.wire: http-outgoing-0 >> "Connection: Keep-Alive[\r][\n]"
DEBUG 08:07:31,869 org.apache.http.wire: http-outgoing-0 >> "Accept: */*[\r][\n]"
DEBUG 08:07:31,869 org.apache.http.wire: http-outgoing-0 >> "User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.98 Safari/537.36[\r][\n]"
DEBUG 08:07:31,869 org.apache.http.wire: http-outgoing-0 >> "Accept-Encoding: gzip, deflate[\r][\n]"
DEBUG 08:07:31,869 org.apache.http.wire: http-outgoing-0 >> "Accept-Language: en-US[\r][\n]"
DEBUG 08:07:31,870 org.apache.http.wire: http-outgoing-0 >> "[\r][\n]"
DEBUG 08:07:31,873 org.apache.http.wire: http-outgoing-0 << "HTTP/1.1 200 [\r][\n]"
DEBUG 08:07:31,873 org.apache.http.wire: http-outgoing-0 << "Accept-Ranges: bytes[\r][\n]"
DEBUG 08:07:31,873 org.apache.http.wire: http-outgoing-0 << "ETag: W/"37-1491113233075"[\r][\n]"
DEBUG 08:07:31,873 org.apache.http.wire: http-outgoing-0 << "Last-Modified: Sun, 02 Apr 2017 06:07:13 GMT[\r][\n]"
DEBUG 08:07:31,873 org.apache.http.wire: http-outgoing-0 << "Content-Type: text/html[\r][\n]"
DEBUG 08:07:31,873 org.apache.http.wire: http-outgoing-0 << "Content-Length: 37[\r][\n]"
DEBUG 08:07:31,875 org.apache.http.wire: http-outgoing-0 << "Date: Sun, 02 Apr 2017 06:07:31 GMT[\r][\n]"
DEBUG 08:07:31,875 org.apache.http.wire: http-outgoing-0 << "[\r][\n]"
DEBUG 08:07:31,875 org.apache.http.wire: http-outgoing-0 << "First[\r][\n]"
DEBUG 08:07:31,875 org.apache.http.wire: http-outgoing-0 << "test"
DEBUG 08:07:32,172 org.apache.http.wire: http-outgoing-0 >> "GET /index2.html HTTP/1.1[\r][\n]"
DEBUG 08:07:32,172 org.apache.http.wire: http-outgoing-0 >> "Host: localhost:8080[\r][\n]"
DEBUG 08:07:32,172 org.apache.http.wire: http-outgoing-0 >> "Connection: Keep-Alive[\r][\n]"
DEBUG 08:07:32,172 org.apache.http.wire: http-outgoing-0 >> "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8[\r][\n]"
DEBUG 08:07:32,172 org.apache.http.wire: http-outgoing-0 >> "User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.98 Safari/537.36[\r][\n]"
DEBUG 08:07:32,173 org.apache.http.wire: http-outgoing-0 >> "Referer: http://localhost:8080/[\r][\n]"
DEBUG 08:07:32,173 org.apache.http.wire: http-outgoing-0 >> "Accept-Encoding: gzip, deflate[\r][\n]"
DEBUG 08:07:32,173 org.apache.http.wire: http-outgoing-0 >> "Accept-Language: en-US[\r][\n]"
DEBUG 08:07:32,173 org.apache.http.wire: http-outgoing-0 >> "[\r][\n]"
DEBUG 08:07:32,174 org.apache.http.wire: http-outgoing-0 << "HTTP/1.1 200 [\r][\n]"
DEBUG 08:07:32,174 org.apache.http.wire: http-outgoing-0 << "Accept-Ranges: bytes[\r][\n]"
DEBUG 08:07:32,174 org.apache.http.wire: http-outgoing-0 << "ETag: W/"6-1491113144011"[\r][\n]"
DEBUG 08:07:32,174 org.apache.http.wire: http-outgoing-0 << "Last-Modified: Sun, 02 Apr 2017 06:05:44 GMT[\r][\n]"
DEBUG 08:07:32,174 org.apache.http.wire: http-outgoing-0 << "Content-Type: text/html[\r][\n]"
DEBUG 08:07:32,175 org.apache.http.wire: http-outgoing-0 << "Content-Length: 6[\r][\n]"
DEBUG 08:07:32,175 org.apache.http.wire: http-outgoing-0 << "Date: Sun, 02 Apr 2017 06:07:31 GMT[\r][\n]"
DEBUG 08:07:32,175 org.apache.http.wire: http-outgoing-0 << "[\r][\n]"
DEBUG 08:07:32,175 org.apache.http.wire: http-outgoing-0 << "Second"

Categories

Resources