{"action":"created","issue":{"url":"https://api.github.com/repos/docker-java/docker-java/issues/712","repository_url":"https://api.github.com/repos/docker-java/docker-java","labels_url":"https://api.github.com/repos/docker-java/docker-java/issues/712/labels{/name}","comments_url":"https://api.github.com/repos/docker-java/docker-java/issues/712/comments","events_url":"https://api.github.com/repos/docker-java/docker-java/issues/712/events","html_url":"https://github.com/docker-java/docker-java/issues/712","id":179115237,"number":712,"title":"Unable connect to docker with docker-java","user":{"login":"neddogg","id":22413234,"avatar_url":"https://avatars.githubusercontent.com/u/22413234?v=3","gravatar_id":"","url":"https://api.github.com/users/neddogg","html_url":"https://github.com/neddogg","followers_url":"https://api.github.com/users/neddogg/followers","following_url":"https://api.github.com/users/neddogg/following{/other_user}","gists_url":"https://api.github.com/users/neddogg/gists{/gist_id}","starred_url":"https://api.github.com/users/neddogg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neddogg/subscriptions","organizations_url":"https://api.github.com/users/neddogg/orgs","repos_url":"https://api.github.com/users/neddogg/repos","events_url":"https://api.github.com/users/neddogg/events{/privacy}","received_events_url":"https://api.github.com/users/neddogg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-25T23:16:29Z","updated_at":"2016-09-25T23:58:02Z","closed_at":null,"body":"Hi Everybody,\r\n\r\nI'm using the docker-java api as my java client to connect to docker. The below code is want I'm using.\r\n\r\n    public class App {\r\n\tpublic static void main(String[] args) {\r\n\t\tDockerClient dockerClient = DockerClientBuilder.getInstance(\"tcp://localhost:2376\").build();\r\n\r\n\t\tInfo info = dockerClient.infoCmd().exec();\r\n                System.out.println(info);\r\n        }\r\n    }\r\n\r\nEach time I run this code, I have some sort of exception now is the stacktrace\r\nException in thread \"main\" javax.ws.rs.ProcessingException: org.apache.http.conn.HttpHostConnectException: Connect to localhost:2376 [localhost/127.0.0.1] failed: Connection refused\r\n\tat org.glassfish.jersey.apache.connector.ApacheConnector.apply(ApacheConnector.java:481)\r\n\tat org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:252)\r\n\tat org.glassfish.jersey.client.JerseyInvocation$2.call(JerseyInvocation.java:701)\r\n\tat org.glassfish.jersey.internal.Errors.process(Errors.java:315)\r\n\tat org.glassfish.jersey.internal.Errors.process(Errors.java:297)\r\n\tat org.glassfish.jersey.internal.Errors.process(Errors.java:228)\r\n\tat org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:444)\r\n\tat org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:697)\r\n\tat org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:420)\r\n\tat org.glassfish.jersey.client.JerseyInvocation$Builder.get(JerseyInvocation.java:316)\r\n\tat com.github.dockerjava.jaxrs.InfoCmdExec.execute(InfoCmdExec.java:26)\r\n\tat com.github.dockerjava.jaxrs.InfoCmdExec.execute(InfoCmdExec.java:13)\r\n\tat com.github.dockerjava.jaxrs.AbstrSyncDockerCmdExec.exec(AbstrSyncDockerCmdExec.java:23)\r\n\tat com.github.dockerjava.core.command.AbstrDockerCmd.exec(AbstrDockerCmd.java:35)\r\n\tat test.docker.java.App.main(App.java:28)\r\nCaused by: org.apache.http.conn.HttpHostConnectException: Connect to localhost:2376 [localhost/127.0.0.1] failed: Connection refused\r\n\tat org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:151)\r\n\tat org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)\r\n\tat org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)\r\n\tat org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)\r\n\tat org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)\r\n\tat org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)\r\n\tat org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)\r\n\tat org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)\r\n\tat org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:71)\r\n\tat org.glassfish.jersey.apache.connector.ApacheConnector.apply(ApacheConnector.java:435)\r\n\t... 14 more\r\nCaused by: java.net.ConnectException: Connection refused\r\n\tat java.net.PlainSocketImpl.socketConnect(Native Method)\r\n\tat java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345)\r\n\tat java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)\r\n\tat java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)\r\n\tat java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)\r\n\tat java.net.Socket.connect(Socket.java:589)\r\n\tat org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:74)\r\n\tat org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:134)\r\n\t... 23 more\r\n\r\nPlease any help will be welcoming.\r\nThanks."},"comment":{"url":"https://api.github.com/repos/docker-java/docker-java/issues/comments/249455057","html_url":"https://github.com/docker-java/docker-java/issues/712#issuecomment-249455057","issue_url":"https://api.github.com/repos/docker-java/docker-java/issues/712","id":249455057,"user":{"login":"neddogg","id":22413234,"avatar_url":"https://avatars.githubusercontent.com/u/22413234?v=3","gravatar_id":"","url":"https://api.github.com/users/neddogg","html_url":"https://github.com/neddogg","followers_url":"https://api.github.com/users/neddogg/followers","following_url":"https://api.github.com/users/neddogg/following{/other_user}","gists_url":"https://api.github.com/users/neddogg/gists{/gist_id}","starred_url":"https://api.github.com/users/neddogg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neddogg/subscriptions","organizations_url":"https://api.github.com/users/neddogg/orgs","repos_url":"https://api.github.com/users/neddogg/repos","events_url":"https://api.github.com/users/neddogg/events{/privacy}","received_events_url":"https://api.github.com/users/neddogg/received_events","type":"User","site_admin":false},"created_at":"2016-09-25T23:58:02Z","updated_at":"2016-09-25T23:58:02Z","body":"I was able to get it working on the local machine by using\r\nDockerClient dockerClient = DockerClientBuilder.getInstance().build();\r\nBut that is not sufficient for me. because when I communicate with some remote docker, I still have the same exception as in the previous post. "}}
{"actor":{"display_login":"neddogg"}}