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

  1. ,
    via Stack Overflow by LittlePanda

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

  2. ,
    Expert tip

    Firewall might be blocking your connection, or MySQL it's not running on your server machine.

Solutions on the web

via GitHub by sheiktajudeen
, 1 year ago
java.net.ConnectException: Connection refused: connect
via GitHub by ErCargo
, 3 weeks ago
java.net.ConnectException: Connection refused (Connection refused)
via Stack Overflow by Junlan Shuai
, 3 months ago
java.net.ConnectException: Connection refused: connect
via GitHub by Juliet-Unsilo
, 4 days ago
java.net.ConnectException: Connection refused (Connection refused)
com.sun.jersey.api.client.ClientHandlerException: java.net.ConnectException: Connection refused: connect at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:187)[jersey-apache-client4-1.19.1.jar:1.19.1] at com.sun.jersey.api.client.filter.GZIPContentEncodingFilter.handle(GZIPContentEncodingFilter.java:123)[jersey-client-1.19.1.jar:1.19.1] at com.netflix.discovery.EurekaIdentityHeaderFilter.handle(EurekaIdentityHeaderFilter.java:27)[eureka-client-1.4.10.jar:1.4.10] at com.sun.jersey.api.client.Client.handle(Client.java:652)[jersey-client-1.19.1.jar:1.19.1] at com.sun.jersey.api.client.WebResource.handle(WebResource.java:682)[jersey-client-1.19.1.jar:1.19.1] at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)[jersey-client-1.19.1.jar:1.19.1] at com.sun.jersey.api.client.WebResource$Builder.get(WebResource.java:509)[jersey-client-1.19.1.jar:1.19.1] at com.netflix.discovery.shared.transport.jersey.AbstractJerseyEurekaHttpClient.getApplicationsInternal(AbstractJerseyEurekaHttpClient.java:194)[eureka-client-1.4.10.jar:1.4.10] at com.netflix.discovery.shared.transport.jersey.AbstractJerseyEurekaHttpClient.getApplications(AbstractJerseyEurekaHttpClient.java:165)[eureka-client-1.4.10.jar:1.4.10] at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$6.execute(EurekaHttpClientDecorator.java:137)[eureka-client-1.4.10.jar:1.4.10] at com.netflix.discovery.shared.transport.decorator.MetricsCollectingEurekaHttpClient.execute(MetricsCollectingEurekaHttpClient.java:73)[eureka-client-1.4.10.jar:1.4.10] at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.getApplications(EurekaHttpClientDecorator.java:134)[eureka-client-1.4.10.jar:1.4.10] at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$6.execute(EurekaHttpClientDecorator.java:137)[eureka-client-1.4.10.jar:1.4.10] at com.netflix.discovery.shared.transport.decorator.RedirectingEurekaHttpClient.executeOnNewServer(RedirectingEurekaHttpClient.java:118)[eureka-client-1.4.10.jar:1.4.10] at com.netflix.discovery.shared.transport.decorator.RedirectingEurekaHttpClient.execute(RedirectingEurekaHttpClient.java:79)[eureka-client-1.4.10.jar:1.4.10] at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.getApplications(EurekaHttpClientDecorator.java:134)[eureka-client-1.4.10.jar:1.4.10] at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$6.execute(EurekaHttpClientDecorator.java:137)[eureka-client-1.4.10.jar:1.4.10] at com.netflix.discovery.shared.transport.decorator.RetryableEurekaHttpClient.execute(RetryableEurekaHttpClient.java:119)[eureka-client-1.4.10.jar:1.4.10] at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.getApplications(EurekaHttpClientDecorator.java:134)[eureka-client-1.4.10.jar:1.4.10] at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$6.execute(EurekaHttpClientDecorator.java:137)[eureka-client-1.4.10.jar:1.4.10] at com.netflix.discovery.shared.transport.decorator.SessionedEurekaHttpClient.execute(SessionedEurekaHttpClient.java:77)[eureka-client-1.4.10.jar:1.4.10] at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.getApplications(EurekaHttpClientDecorator.java:134)[eureka-client-1.4.10.jar:1.4.10] at com.netflix.discovery.DiscoveryClient.getAndStoreFullRegistry(DiscoveryClient.java:1030)[eureka-client-1.4.10.jar:1.4.10] at com.netflix.discovery.DiscoveryClient.fetchRegistry(DiscoveryClient.java:944)[eureka-client-1.4.10.jar:1.4.10] at com.netflix.discovery.DiscoveryClient.<init>(DiscoveryClient.java:444)[eureka-client-1.4.10.jar:1.4.10] at com.netflix.discovery.DiscoveryClient.<init>(DiscoveryClient.java:304)[eureka-client-1.4.10.jar:1.4.10] at org.springframework.cloud.netflix.eureka.CloudEurekaClient.<init>(CloudEurekaClient.java:51)[spring-cloud-netflix-eureka-client-1.1.6.BUILD-SNAPSHOT.jar:1.1.6.BUILD-SNAPSHOT] at org.springframework.cloud.netflix.eureka.EurekaClientAutoConfiguration$RefreshableEurekaClientConfiguration.eurekaClient(EurekaClientAutoConfiguration.java:179)[spring-cloud-netflix-eureka-client-1.1.6.BUILD-SNAPSHOT.jar:1.1.6.BUILD-SNAPSHOT] at org.springframework.cloud.netflix.eureka.EurekaClientAutoConfiguration$RefreshableEurekaClientConfiguration$$EnhancerBySpringCGLIB$$a60e1e7d.CGLIB$eurekaClient$1(<generated>)[spring-cloud-netflix-eureka-client-1.1.6.BUILD-SNAPSHOT.jar:1.1.6.BUILD-SNAPSHOT] at org.springframework.cloud.netflix.eureka.EurekaClientAutoConfiguration$RefreshableEurekaClientConfiguration$$EnhancerBySpringCGLIB$$a60e1e7d$$FastClassBySpringCGLIB$$670f868d.invoke(<generated>)[spring-cloud-netflix-eureka-client-1.1.6.BUILD-SNAPSHOT.jar:1.1.6.BUILD-SNAPSHOT] at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)[spring-core-4.3.2.RELEASE.jar:4.3.2.RELEASE] at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:356)[spring-context-4.3.2.RELEASE.jar:4.3.2.RELEASE] at org.springframework.cloud.netflix.eureka.EurekaClientAutoConfiguration$RefreshableEurekaClientConfiguration$$EnhancerBySpringCGLIB$$a60e1e7d.eurekaClient(<generated>)[spring-cloud-netflix-eureka-client-1.1.6.BUILD-SNAPSHOT.jar:1.1.6.BUILD-SNAPSHOT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[na:1.8.0_91] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)[na:1.8.0_91] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)[na:1.8.0_91] at java.lang.reflect.Method.invoke(Unknown Source)[na:1.8.0_91] at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE] at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1123)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1018)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory$2.getObject(AbstractBeanFactory.java:345)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE] at org.springframework.cloud.context.scope.GenericScope$BeanLifecycleWrapper.getBean(GenericScope.java:359)[spring-cloud-context-1.1.2.BUILD-SNAPSHOT.jar:1.1.2.BUILD-SNAPSHOT] at org.springframework.cloud.context.scope.GenericScope.get(GenericScope.java:176)[spring-cloud-context-1.1.2.BUILD-SNAPSHOT.jar:1.1.2.BUILD-SNAPSHOT] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:340)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE] at org.springframework.aop.target.SimpleBeanTargetSource.getTarget(SimpleBeanTargetSource.java:35)[spring-aop-4.3.2.RELEASE.jar:4.3.2.RELEASE] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:192)[spring-aop-4.3.2.RELEASE.jar:4.3.2.RELEASE] at com.sun.proxy.$Proxy89.getApplications(Unknown Source)[na:na] at org.springframework.cloud.netflix.eureka.EurekaDiscoveryClientConfiguration.maybeInitializeClient(EurekaDiscoveryClientConfiguration.java:120)[spring-cloud-netflix-eureka-client-1.1.6.BUILD-SNAPSHOT.jar:1.1.6.BUILD-SNAPSHOT] at org.springframework.cloud.netflix.eureka.EurekaDiscoveryClientConfiguration.start(EurekaDiscoveryClientConfiguration.java:97)[spring-cloud-netflix-eureka-client-1.1.6.BUILD-SNAPSHOT.jar:1.1.6.BUILD-SNAPSHOT] at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:173)[spring-context-4.3.2.RELEASE.jar:4.3.2.RELEASE] at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:51)[spring-context-4.3.2.RELEASE.jar:4.3.2.RELEASE] at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:346)[spring-context-4.3.2.RELEASE.jar:4.3.2.RELEASE] at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:149)[spring-context-4.3.2.RELEASE.jar:4.3.2.RELEASE] at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:112)[spring-context-4.3.2.RELEASE.jar:4.3.2.RELEASE] at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:874)[spring-context-4.3.2.RELEASE.jar:4.3.2.RELEASE] at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:144)[spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:544)[spring-context-4.3.2.RELEASE.jar:4.3.2.RELEASE] at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)[spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759)[spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:369)[spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:313)[spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1185)[spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1174)[spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE] at com.comcast.activation.sparrow.ZuulRetryerApplication.main(ZuulRetryerApplication.java:29)[classes/:na]Caused by: java.net.ConnectException: Connection refused: connect at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)[na:1.8.0_91] at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)[na:1.8.0_91] at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)[na:1.8.0_91] at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)[na:1.8.0_91] at java.net.AbstractPlainSocketImpl.connect(Unknown Source)[na:1.8.0_91] at java.net.PlainSocketImpl.connect(Unknown Source)[na:1.8.0_91] at java.net.SocksSocketImpl.connect(Unknown Source)[na:1.8.0_91] at java.net.Socket.connect(Unknown Source)[na:1.8.0_91] at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:120)[httpclient-4.5.2.jar:4.5.2] at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:179)[httpclient-4.5.2.jar:4.5.2] at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:144)[httpclient-4.5.2.jar:4.5.2] at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:134)[httpclient-4.5.2.jar:4.5.2] at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:612)[httpclient-4.5.2.jar:4.5.2] at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:447)[httpclient-4.5.2.jar:4.5.2] at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:884)[httpclient-4.5.2.jar:4.5.2] at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:117)[httpclient-4.5.2.jar:4.5.2] at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55)[httpclient-4.5.2.jar:4.5.2] at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:173)[jersey-apache-client4-1.19.1.jar:1.19.1] ... 67 more