org.apache.http.conn.HttpHostConnectException: Connect to localhost:8080 [localhost/] failed: Connection refused

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

via GitHub by rawlingsj

host port isnt set

via Stack Overflow by LittlePanda

To restart the Selenium Webdriver mock browser in a testcase, first use driver.close() and then reinstantiate the driver.

Solutions on the web

via GitHub by cblanco
, 1 year ago
Connect to localhost:8080 [localhost/] failed: Connection refused
via Google Groups by Unknown author, 1 year ago
Connect to localhost:8080 [ localhost/, localhost/0:0:0:0:0:0:0:1] failed: Connection refused
via Stack Overflow by vkrams
, 3 months ago
Connect to localhost:8080 [localhost/, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect
via GitHub by jacks808
, 1 year ago
Connect to localhost:8088 [localhost/] failed: 拒绝连接 (Connection refused)
via GitHub by jpcoder2
, 6 months ago
Connect to [] failed: Connection timed out: connect
via Stack Overflow by ludenus
, 9 months ago
Connect to localhost:8080 [localhost/, localhost/0:0:0:0:0:0:0:1] failed: Connection refused Connection refused
at Method)
at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(
at org.apache.http.impl.execchain.MainClientExec.establishRoute(
at org.apache.http.impl.execchain.MainClientExec.execute(
at org.apache.http.impl.execchain.ProtocolExec.execute(
at org.apache.http.impl.client.InternalHttpClient.doExecute(
at org.apache.http.impl.client.CloseableHttpClient.execute(
at com.github.tomakehurst.wiremock.client.HttpAdminClient.safelyExecuteRequest(
at com.github.tomakehurst.wiremock.client.HttpAdminClient.postJsonAssertOkAndReturnBody(
at com.github.tomakehurst.wiremock.client.HttpAdminClient.addStubMapping(
at com.github.tomakehurst.wiremock.client.WireMock.register(
at com.github.tomakehurst.wiremock.client.WireMock.register(
at undefined.DD.myT(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
at org.junit.runners.model.FrameworkMethod.invokeExplosively(
at org.junit.internal.runners.statements.InvokeMethod.evaluate(
at org.junit.internal.runners.statements.FailOnTimeout$

Users with the same issue

115 times, 32 seconds ago
11 times, 1 day ago
26943 times, 1 day ago
4 times, 3 days ago
5 times, 3 days ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.