java.net.ConnectException: Connection refused (Connection refused)


Samebug tips10

Check if ip adress is correct, if the port is correct, and if the server is up and running and waiting for connections. Also, check if there's no firewall blocking you and if your internet connection is working.


7 months ago
Expert tip

Check if your MongoDB is available.


10 months ago

Solutions on the web3

Solution icon of github
via GitHub by jschristie
, 9 months ago
Connection refused (Connection refused)

Solution icon of googlegroups
via Google Groups by Deepankar Dhoundiyal, 9 months ago
Connection refused: connect')

Solution icon of web
Connection refused: connect')

Stack trace

java.net.ConnectException: Connection refused (Connection refused)
	at com.unboundid.ldap.sdk.LDAPConnection.connect(LDAPConnection.java:869)[unboundid-ldapsdk-3.1.1.jar:3.1.1]
	at com.unboundid.ldap.sdk.LDAPConnection.connect(LDAPConnection.java:759)[unboundid-ldapsdk-3.1.1.jar:3.1.1]
	at com.unboundid.ldap.sdk.LDAPConnection.connect(LDAPConnection.java:709)[unboundid-ldapsdk-3.1.1.jar:3.1.1]
	at com.unboundid.ldap.sdk.LDAPConnection.<init>(LDAPConnection.java:533)[unboundid-ldapsdk-3.1.1.jar:3.1.1]
	at com.unboundid.ldap.sdk.SingleServerSet.getConnection(SingleServerSet.java:229)[unboundid-ldapsdk-3.1.1.jar:3.1.1]
	at com.unboundid.ldap.sdk.ServerSet.getConnection(ServerSet.java:98)[unboundid-ldapsdk-3.1.1.jar:3.1.1]
	at com.unboundid.ldap.sdk.FailoverServerSet.getConnection(FailoverServerSet.java:545)[unboundid-ldapsdk-3.1.1.jar:3.1.1]
	at com.unboundid.ldap.sdk.LDAPConnectionPool.createConnection(LDAPConnectionPool.java:1204)[unboundid-ldapsdk-3.1.1.jar:3.1.1]
	at com.unboundid.ldap.sdk.LDAPConnectionPool.createConnection(LDAPConnectionPool.java:1177)[unboundid-ldapsdk-3.1.1.jar:3.1.1]
	at com.unboundid.ldap.sdk.LDAPConnectionPool.<init>(LDAPConnectionPool.java:1114)[unboundid-ldapsdk-3.1.1.jar:3.1.1]
	at com.unboundid.ldap.sdk.LDAPConnectionPool.<init>(LDAPConnectionPool.java:996)[unboundid-ldapsdk-3.1.1.jar:3.1.1]
	at com.unboundid.ldap.sdk.LDAPConnectionPool.<init>(LDAPConnectionPool.java:933)[unboundid-ldapsdk-3.1.1.jar:3.1.1]
	at com.unboundid.ldap.sdk.LDAPConnectionPool.<init>(LDAPConnectionPool.java:876)[unboundid-ldapsdk-3.1.1.jar:3.1.1]
	at com.unboundid.ldap.sdk.LDAPConnectionPool.<init>(LDAPConnectionPool.java:791)[unboundid-ldapsdk-3.1.1.jar:3.1.1]
	at org.gluu.site.ldap.LDAPConnectionProvider.createConnectionPoolImpl(LDAPConnectionProvider.java:200)[oxLdap-3.0.0-SNAPSHOT.jar:?]
	at org.gluu.site.ldap.LDAPConnectionProvider.createConnectionPoolWithWaitImpl(LDAPConnectionProvider.java:170)[oxLdap-3.0.0-SNAPSHOT.jar:?]
	at org.gluu.site.ldap.LDAPConnectionProvider.init(LDAPConnectionProvider.java:127)[oxLdap-3.0.0-SNAPSHOT.jar:?]
	at org.gluu.site.ldap.LDAPConnectionProvider.<init>(LDAPConnectionProvider.java:63)[oxLdap-3.0.0-SNAPSHOT.jar:?]
	at org.xdi.service.ldap.LdapConnectionService.<init>(LdapConnectionService.java:21)[oxService-3.0.0-SNAPSHOT.jar:?]
	at org.gluu.oxtrust.ldap.service.AppInitializer.createConnectionAuthProvider(AppInitializer.java:215)[classes/:?]
	at org.gluu.oxtrust.ldap.service.AppInitializer.createApplicationComponents(AppInitializer.java:131)[classes/:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[?:1.8.0_112]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[?:1.8.0_112]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[?:1.8.0_112]
	at java.lang.reflect.Method.invoke(Method.java:498)[?:1.8.0_112]
	at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)[jboss-seam-2.3.1.Final.jar:2.3.1.Final]
	at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)[jboss-seam-2.3.1.Final.jar:2.3.1.Final]
	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)[jboss-seam-2.3.1.Final.jar:2.3.1.Final]
	at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)[jboss-seam-2.3.1.Final.jar:2.3.1.Final]
	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)[jboss-seam-2.3.1.Final.jar:2.3.1.Final]
	at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:79)[jboss-seam-2.3.1.Final.jar:2.3.1.Final]
	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)[jboss-seam-2.3.1.Final.jar:2.3.1.Final]
	at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)[jboss-seam-2.3.1.Final.jar:2.3.1.Final]
	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)[jboss-seam-2.3.1.Final.jar:2.3.1.Final]
	at org.jboss.seam.async.AsynchronousInterceptor.aroundInvoke(AsynchronousInterceptor.java:52)[jboss-seam-2.3.1.Final.jar:2.3.1.Final]
	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)[jboss-seam-2.3.1.Final.jar:2.3.1.Final]
	at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)[jboss-seam-2.3.1.Final.jar:2.3.1.Final]
	at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:196)[jboss-seam-2.3.1.Final.jar:2.3.1.Final]
	at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:114)[jboss-seam-2.3.1.Final.jar:2.3.1.Final]
	at org.gluu.oxtrust.ldap.service.AppInitializer_$$_javassist_seam_9.createApplicationComponents(AppInitializer_$$_javassist_seam_9.java)[classes/:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[?:1.8.0_112]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[?:1.8.0_112]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[?:1.8.0_112]
	at java.lang.reflect.Method.invoke(Method.java:498)[?:1.8.0_112]
	at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)[jboss-seam-2.3.1.Final.jar:2.3.1.Final]
	at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)[jboss-seam-2.3.1.Final.jar:2.3.1.Final]
	at org.jboss.seam.Component.callComponentMethod(Component.java:2313)[jboss-seam-2.3.1.Final.jar:2.3.1.Final]
	at org.jboss.seam.Component.callCreateMethod(Component.java:2236)[jboss-seam-2.3.1.Final.jar:2.3.1.Final]
	at org.jboss.seam.Component.newInstance(Component.java:2196)[jboss-seam-2.3.1.Final.jar:2.3.1.Final]
	at org.jboss.seam.contexts.Contexts.startup(Contexts.java:343)[jboss-seam-2.3.1.Final.jar:2.3.1.Final]
	at org.jboss.seam.contexts.Contexts.startup(Contexts.java:335)[jboss-seam-2.3.1.Final.jar:2.3.1.Final]
	at org.jboss.seam.contexts.Contexts.startup(Contexts.java:317)[jboss-seam-2.3.1.Final.jar:2.3.1.Final]
	at org.jboss.seam.contexts.ServletLifecycle.endInitialization(ServletLifecycle.java:143)[jboss-seam-2.3.1.Final.jar:2.3.1.Final]
	at org.jboss.seam.init.Initialization.init(Initialization.java:813)[jboss-seam-2.3.1.Final.jar:2.3.1.Final]
	at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:36)[jboss-seam-2.3.1.Final.jar:2.3.1.Final]
	at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:843)[jetty-server-9.3.14.v20161028.jar:9.3.14.v20161028]
	at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:533)[jetty-servlet-9.3.14.v20161028.jar:9.3.14.v20161028]
	at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:816)[jetty-server-9.3.14.v20161028.jar:9.3.14.v20161028]
	at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:345)[jetty-servlet-9.3.14.v20161028.jar:9.3.14.v20161028]
	at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1404)[jetty-webapp-9.3.14.v20161028.jar:9.3.14.v20161028]
	at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1366)[jetty-webapp-9.3.14.v20161028.jar:9.3.14.v20161028]
	at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:778)[jetty-server-9.3.14.v20161028.jar:9.3.14.v20161028]
	at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:262)[jetty-servlet-9.3.14.v20161028.jar:9.3.14.v20161028]
	at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:520)[jetty-webapp-9.3.14.v20161028.jar:9.3.14.v20161028]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)[jetty-util-9.3.14.v20161028.jar:9.3.14.v20161028]
	at org.eclipse.jetty.deploy.bindings.StandardStarter.processBinding(StandardStarter.java:41)[jetty-deploy-9.3.14.v20161028.jar:9.3.14.v20161028]
	at org.eclipse.jetty.deploy.AppLifeCycle.runBindings(AppLifeCycle.java:188)[jetty-deploy-9.3.14.v20161028.jar:9.3.14.v20161028]
	at org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(DeploymentManager.java:499)[jetty-deploy-9.3.14.v20161028.jar:9.3.14.v20161028]
	at org.eclipse.jetty.deploy.DeploymentManager.addApp(DeploymentManager.java:147)[jetty-deploy-9.3.14.v20161028.jar:9.3.14.v20161028]
	at org.eclipse.jetty.deploy.providers.ScanningAppProvider.fileAdded(ScanningAppProvider.java:180)[jetty-deploy-9.3.14.v20161028.jar:9.3.14.v20161028]
	at org.eclipse.jetty.deploy.providers.WebAppProvider.fileAdded(WebAppProvider.java:452)[jetty-deploy-9.3.14.v20161028.jar:9.3.14.v20161028]
	at org.eclipse.jetty.deploy.providers.ScanningAppProvider$1.fileAdded(ScanningAppProvider.java:64)[jetty-deploy-9.3.14.v20161028.jar:9.3.14.v20161028]
	at org.eclipse.jetty.util.Scanner.reportAddition(Scanner.java:610)[jetty-util-9.3.14.v20161028.jar:9.3.14.v20161028]
	at org.eclipse.jetty.util.Scanner.reportDifferences(Scanner.java:529)[jetty-util-9.3.14.v20161028.jar:9.3.14.v20161028]
	at org.eclipse.jetty.util.Scanner.scan(Scanner.java:392)[jetty-util-9.3.14.v20161028.jar:9.3.14.v20161028]
	at org.eclipse.jetty.util.Scanner.doStart(Scanner.java:313)[jetty-util-9.3.14.v20161028.jar:9.3.14.v20161028]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)[jetty-util-9.3.14.v20161028.jar:9.3.14.v20161028]
	at org.eclipse.jetty.deploy.providers.ScanningAppProvider.doStart(ScanningAppProvider.java:150)[jetty-deploy-9.3.14.v20161028.jar:9.3.14.v20161028]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)[jetty-util-9.3.14.v20161028.jar:9.3.14.v20161028]
	at org.eclipse.jetty.deploy.DeploymentManager.startAppProvider(DeploymentManager.java:561)[jetty-deploy-9.3.14.v20161028.jar:9.3.14.v20161028]
	at org.eclipse.jetty.deploy.DeploymentManager.doStart(DeploymentManager.java:236)[jetty-deploy-9.3.14.v20161028.jar:9.3.14.v20161028]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)[jetty-util-9.3.14.v20161028.jar:9.3.14.v20161028]
	at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)[jetty-util-9.3.14.v20161028.jar:9.3.14.v20161028]
	at org.eclipse.jetty.server.Server.start(Server.java:422)[jetty-server-9.3.14.v20161028.jar:9.3.14.v20161028]
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:113)[jetty-util-9.3.14.v20161028.jar:9.3.14.v20161028]
	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)[jetty-server-9.3.14.v20161028.jar:9.3.14.v20161028]
	at org.eclipse.jetty.server.Server.doStart(Server.java:389)[jetty-server-9.3.14.v20161028.jar:9.3.14.v20161028]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)[jetty-util-9.3.14.v20161028.jar:9.3.14.v20161028]
	at org.eclipse.jetty.xml.XmlConfiguration$1.run(XmlConfiguration.java:1516)[jetty-xml-9.3.14.v20161028.jar:9.3.14.v20161028]
	at java.security.AccessController.doPrivileged(Native Method)[?:1.8.0_112]
	at org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:1441)[jetty-xml-9.3.14.v20161028.jar:9.3.14.v20161028]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[?:1.8.0_112]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[?:1.8.0_112]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[?:1.8.0_112]
	at java.lang.reflect.Method.invoke(Method.java:498)[?:1.8.0_112]
	at org.eclipse.jetty.start.Main.invokeMain(Main.java:214)[start.jar:9.3.14.v20161028]
	at org.eclipse.jetty.start.Main.start(Main.java:457)[start.jar:9.3.14.v20161028]
	at org.eclipse.jetty.start.Main.main(Main.java:75)[start.jar:9.3.14.v20161028]
Caused by: java.io.IOException: LDAPException(resultCode=91 (connect error), errorMessage='An error occurred while attempting to establish a connection to server gluu3-
ubuntu.workgroup.com/192.168.157.143:1636:  java.net.ConnectException: Connection refused (Connection refused)')
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)[?:1.8.0_112]
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)[?:1.8.0_112]
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)[?:1.8.0_112]
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)[?:1.8.0_112]
	at com.unboundid.util.StaticUtils.createIOExceptionWithCause(StaticUtils.java:2518)[unboundid-ldapsdk-3.1.1.jar:3.1.1]
	at com.unboundid.ldap.sdk.LDAPConnectionInternals.<init>(LDAPConnectionInternals.java:172)[unboundid-ldapsdk-3.1.1.jar:3.1.1]
	at com.unboundid.ldap.sdk.LDAPConnection.connect(LDAPConnection.java:859)[unboundid-ldapsdk-3.1.1.jar:3.1.1]
	... 97 more
Caused by: com.unboundid.ldap.sdk.LDAPException: An error occurred while attempting to establish a connection to server gluu3-ubuntu.workgroup.com/192.168.157.143:1636:
  java.net.ConnectException: Connection refused (Connection refused)
	at com.unboundid.ldap.sdk.ConnectThread.getConnectedSocket(ConnectThread.java:240)[unboundid-ldapsdk-3.1.1.jar:3.1.1]
	at com.unboundid.ldap.sdk.LDAPConnectionInternals.<init>(LDAPConnectionInternals.java:161)[unboundid-ldapsdk-3.1.1.jar:3.1.1]
	... 98 more
Caused by: java.net.ConnectException: Connection refused (Connection refused)
	at java.net.PlainSocketImpl.socketConnect(Native Method)[?:1.8.0_112]
	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)[?:1.8.0_112]
	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)[?:1.8.0_112]
	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)[?:1.8.0_112]
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)[?:1.8.0_112]
	at java.net.Socket.connect(Socket.java:589)[?:1.8.0_112]
	at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:668)[?:1.8.0_112]
	at com.unboundid.util.ssl.SetEnabledProtocolsSocket.connect(SetEnabledProtocolsSocket.java:123)[unboundid-ldapsdk-3.1.1.jar:3.1.1]
	at com.unboundid.ldap.sdk.ConnectThread.run(ConnectThread.java:146)[unboundid-ldapsdk-3.1.1.jar:3.1.1]

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

861 times, 5 hours ago
32 times, 1 week ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Once, 2 months ago
2 times, 3 months ago
503 more bugmates