eclipse - Docker-client Java API : The server failed to respond with a valid HTTP response -


managed solve issue posted yesterday java client library couldn't connect daemon have new problem cant find info online.

i ran boot2docker v1.6 windows installer on win7 64 bit. can run docker commands fine. pulled latest docker-client master branch (v2.7.22) https://github.com/spotify/docker-client , ran in eclipse java ide. in defaultdockerclient changed default_host , default_port values docker seemed using https://docs.docker.com/installation/images/windows-boot2docker-cmd.png (the default values giving me localhost:2375 connection refused errors).

i tried running following commands:

final dockerclient docker = defaultdockerclient.fromenv().build(); list results = docker.searchimages("ubuntu"); 

my result apache error going:

 exception in thread "main" com.spotify.docker.client.dockerexception: java.util.concurrent.executionexception: javax.ws.rs.processingexception: org.apache.http.client.clientprotocolexception @ com.spotify.docker.client.defaultdockerclient.propagate(defaultdockerclient.java:1109) @ com.spotify.docker.client.defaultdockerclient.request(defaultdockerclient.java:1028) @ com.spotify.docker.client.defaultdockerclient.searchimages(defaultdockerclient.java:653) @ com.spotify.docker.client.main.test.main(test.java:28) caused by: java.util.concurrent.executionexception: javax.ws.rs.processingexception: org.apache.http.client.clientprotocolexception @ jersey.repackaged.com.google.common.util.concurrent.abstractfuture$sync.getvalue(abstractfuture.java:306) @ jersey.repackaged.com.google.common.util.concurrent.abstractfuture$sync.get(abstractfuture.java:293) @ jersey.repackaged.com.google.common.util.concurrent.abstractfuture.get(abstractfuture.java:116) @ com.spotify.docker.client.defaultdockerclient.request(defaultdockerclient.java:1026) ... 2 more caused by: javax.ws.rs.processingexception: org.apache.http.client.clientprotocolexception @ org.glassfish.jersey.apache.connector.apacheconnector.apply(apacheconnector.java:517) @ org.glassfish.jersey.apache.connector.apacheconnector$1.run(apacheconnector.java:527) @ java.util.concurrent.executors$runnableadapter.call(unknown source) @ java.util.concurrent.futuretask.run(unknown source) @ jersey.repackaged.com.google.common.util.concurrent.moreexecutors$samethreadexecutorservice.execute(moreexecutors.java:293) @ jersey.repackaged.com.google.common.util.concurrent.abstractlisteningexecutorservice.submit(abstractlisteningexecutorservice.java:49) @ jersey.repackaged.com.google.common.util.concurrent.abstractlisteningexecutorservice.submit(abstractlisteningexecutorservice.java:45) @ org.glassfish.jersey.apache.connector.apacheconnector.apply(apacheconnector.java:523) @ org.glassfish.jersey.client.clientruntime$1.run(clientruntime.java:169) @ org.glassfish.jersey.internal.errors$1.call(errors.java:271) @ org.glassfish.jersey.internal.errors$1.call(errors.java:267) @ org.glassfish.jersey.internal.errors.process(errors.java:315) @ org.glassfish.jersey.internal.errors.process(errors.java:297) @ org.glassfish.jersey.internal.errors.process(errors.java:267) @ org.glassfish.jersey.process.internal.requestscope.runinscope(requestscope.java:320) @ org.glassfish.jersey.client.clientruntime$2.run(clientruntime.java:201) @ java.util.concurrent.executors$runnableadapter.call(unknown source) @ java.util.concurrent.futuretask.run(unknown source) @ java.util.concurrent.threadpoolexecutor.runworker(unknown source) @ java.util.concurrent.threadpoolexecutor$worker.run(unknown source) @ java.lang.thread.run(unknown source) caused by: org.apache.http.client.clientprotocolexception @ org.apache.http.impl.client.internalhttpclient.doexecute(internalhttpclient.java:186) @ org.apache.http.impl.client.closeablehttpclient.execute(closeablehttpclient.java:72) @ org.glassfish.jersey.apache.connector.apacheconnector.apply(apacheconnector.java:469) ... 20 more caused by: org.apache.http.protocolexception: server failed respond valid http response @ org.apache.http.impl.conn.defaulthttpresponseparser.parsehead(defaulthttpresponseparser.java:151) @ org.apache.http.impl.conn.defaulthttpresponseparser.parsehead(defaulthttpresponseparser.java:57) @ org.apache.http.impl.io.abstractmessageparser.parse(abstractmessageparser.java:260) @ org.apache.http.impl.defaultbhttpclientconnection.receiveresponseheader(defaultbhttpclientconnection.java:161) @ org.apache.http.impl.conn.cpoolproxy.receiveresponseheader(cpoolproxy.java:153) @ org.apache.http.protocol.httprequestexecutor.doreceiveresponse(httprequestexecutor.java:271) @ org.apache.http.protocol.httprequestexecutor.execute(httprequestexecutor.java:123) @ org.apache.http.impl.execchain.mainclientexec.execute(mainclientexec.java:254) @ org.apache.http.impl.execchain.protocolexec.execute(protocolexec.java:195) @ org.apache.http.impl.execchain.retryexec.execute(retryexec.java:86) @ org.apache.http.impl.execchain.redirectexec.execute(redirectexec.java:108) @ org.apache.http.impl.client.internalhttpclient.doexecute(internalhttpclient.java:184) ... 22 more 

does know how can read http message/where logs stored apache library? tried using v2.7.21 client version had same errors.

any ideas how solve or else on here using same library in combination boot2docker windows installer? looking advice people using library please

i'm guessing not have docker_cert_path environment variable set, because able reproduce exception running 2 lines after unsetting own docker_cert_path.

also "connection refused" errors have been avoided if docker_host environment variables set correctly. again, can reproduce unsetting own docker_host variable.

the values need set these environment variables displayed @ end of boot2docker init command, described @ https://docs.docker.com/installation/mac/. can see them again running boot2docker shellinit.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -