javax.naming.CommunicationException

If you like a tip written by other Samebug users, mark is as helpful! Marks help our algorithm provide you better solutions and also help other users.
tip

Check if your server (or a proxy server) is not going up and down. There might be something between a proxy and a client sending intermittent requests to non-functioning hosts as well. There might as well be too many requests in a short amount of time.

tip

Check if your server (or a proxy server) is not going up and down. There might be something between a proxy and a client sending intermittent requests to non-functioning hosts as well. There might as well be too many requests in a short amount of time.

tip

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.


rafaelrafael
tip

Check if your MongoDB is available.


rprp
tip

host port isnt set

tip

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

tip

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


rafaelrafael
tip

Check if you have started your server, or if your server is set to listen to the port you're trying to connect and is waiting to accept connections and check if the firewall isn't blocking your connection.


rafaelrafael
tip

spring-data-redis requires redis 2.6+ to work properly.

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

  • I ran the same JMeter test as in NEXUS-2803, but this time with the LDAP realm enabled. The LDAP realm is listed below the XML realms, and the anonymous user is in the XML realm (and anonymous access is enabled). I'm seeing significant access to the LDAP server. Lots of timeouts (as listed below), and far worse performance. I finally stopped the test since it hadn't finished yet in about 20 minutes (without the ldap realm this test runs in about 4 minutes in Nexus 1.4). {code} 2009-10-05 10:59:23 ERROR [qtp-11511434-11] - o.j.r.l.AbstractLda~ - LDAP naming error while attempting to authenticate user. javax.naming.CommunicationException: ldap.sonatype.com:636 [Root exception is java.net.ConnectException: Connection timed out: connect] at com.sun.jndi.ldap.Connection.<init>(Unknown Source) at com.sun.jndi.ldap.LdapClient.<init>(Unknown Source) at com.sun.jndi.ldap.LdapClient.getInstance(Unknown Source) at com.sun.jndi.ldap.LdapCtx.connect(Unknown Source) at com.sun.jndi.ldap.LdapCtx.<init>(Unknown Source) at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(Unknown Source) at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(Unknown Source) at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(Unknown Source) at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(Unknown Source) at javax.naming.spi.NamingManager.getInitialContext(Unknown Source) at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source) at javax.naming.InitialContext.init(Unknown Source) at javax.naming.ldap.InitialLdapContext.<init>(Unknown Source) at com.sonatype.security.ldap.realms.PlexusLdapContextFactory.itm(Unknown Source) at com.sonatype.security.ldap.realms.PlexusLdapContextFactory.getSystemLdapContext(Unknown Source) at com.sonatype.security.ldap.realms.ConfigurableLdapAuthenticatingRealm.queryForAuthenticationInfo(Unknown Source) at codeguard.nexusldaprealmplugin.apnpz.queryForAuthenticationInfo(Unknown Source) at org.jsecurity.realm.ldap.AbstractLdapRealm.doGetAuthenticationInfo(AbstractLdapRealm.java:186) at org.jsecurity.realm.AuthenticatingRealm.getAuthenticationInfo(AuthenticatingRealm.java:168) at org.jsecurity.authc.pam.ModularRealmAuthenticator.doMultiRealmAuthentication(ModularRealmAuthenticator.java:226) at org.jsecurity.authc.pam.ModularRealmAuthenticator.doAuthenticate(ModularRealmAuthenticator.java:278) at org.jsecurity.authc.AbstractAuthenticator.authenticate(AbstractAuthenticator.java:141) at org.jsecurity.mgt.AuthenticatingSecurityManager.authenticate(AuthenticatingSecurityManager.java:171) at org.jsecurity.mgt.DefaultSecurityManager.login(DefaultSecurityManager.java:312) at org.jsecurity.subject.DelegatingSubject.login(DelegatingSubject.java:237) at org.sonatype.nexus.security.filter.authc.NexusHttpAuthenticationFilter.executeAnonymousLogin(NexusHttpAuthenticationFilter.java:213) at org.sonatype.nexus.security.filter.authc.NexusHttpAuthenticationFilter.onAccessDenied(NexusHttpAuthenticationFilter.java:144) at org.jsecurity.web.filter.AccessControlFilter.onPreHandle(AccessControlFilter.java:145) at org.jsecurity.web.filter.PathMatchingFilter.preHandle(PathMatchingFilter.java:175) at org.jsecurity.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:129) at org.jsecurity.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:180) at org.jsecurity.web.servlet.FilterChainWrapper.doFilter(FilterChainWrapper.java:57) at org.jsecurity.web.servlet.JSecurityFilter.doFilterInternal(JSecurityFilter.java:382) at org.jsecurity.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:180) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:387) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:864) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:539) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520) Caused by: java.net.ConnectException: Connection timed out: connect at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(Unknown Source) at java.net.PlainSocketImpl.connectToAddress(Unknown Source) at java.net.PlainSocketImpl.connect(Unknown Source) at java.net.SocksSocketImpl.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(Unknown Source) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.<init>(Unknown Source) at com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl.createSocket(Unknown Source) at sun.reflect.GeneratedMethodAccessor39.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.sun.jndi.ldap.Connection.createSocket(Unknown Source) ... 50 more {code}
    via by Rich Seddon,
  • I ran the same JMeter test as in NEXUS-2803, but this time with the LDAP realm enabled. The LDAP realm is listed below the XML realms, and the anonymous user is in the XML realm (and anonymous access is enabled). I'm seeing significant access to the LDAP server. Lots of timeouts (as listed below), and far worse performance. I finally stopped the test since it hadn't finished yet in about 20 minutes (without the ldap realm this test runs in about 4 minutes in Nexus 1.4). {code} 2009-10-05 10:59:23 ERROR [qtp-11511434-11] - o.j.r.l.AbstractLda~ - LDAP naming error while attempting to authenticate user. javax.naming.CommunicationException: ldap.sonatype.com:636 [Root exception is java.net.ConnectException: Connection timed out: connect] at com.sun.jndi.ldap.Connection.<init>(Unknown Source) at com.sun.jndi.ldap.LdapClient.<init>(Unknown Source) at com.sun.jndi.ldap.LdapClient.getInstance(Unknown Source) at com.sun.jndi.ldap.LdapCtx.connect(Unknown Source) at com.sun.jndi.ldap.LdapCtx.<init>(Unknown Source) at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(Unknown Source) at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(Unknown Source) at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(Unknown Source) at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(Unknown Source) at javax.naming.spi.NamingManager.getInitialContext(Unknown Source) at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source) at javax.naming.InitialContext.init(Unknown Source) at javax.naming.ldap.InitialLdapContext.<init>(Unknown Source) at com.sonatype.security.ldap.realms.PlexusLdapContextFactory.itm(Unknown Source) at com.sonatype.security.ldap.realms.PlexusLdapContextFactory.getSystemLdapContext(Unknown Source) at com.sonatype.security.ldap.realms.ConfigurableLdapAuthenticatingRealm.queryForAuthenticationInfo(Unknown Source) at codeguard.nexusldaprealmplugin.apnpz.queryForAuthenticationInfo(Unknown Source) at org.jsecurity.realm.ldap.AbstractLdapRealm.doGetAuthenticationInfo(AbstractLdapRealm.java:186) at org.jsecurity.realm.AuthenticatingRealm.getAuthenticationInfo(AuthenticatingRealm.java:168) at org.jsecurity.authc.pam.ModularRealmAuthenticator.doMultiRealmAuthentication(ModularRealmAuthenticator.java:226) at org.jsecurity.authc.pam.ModularRealmAuthenticator.doAuthenticate(ModularRealmAuthenticator.java:278) at org.jsecurity.authc.AbstractAuthenticator.authenticate(AbstractAuthenticator.java:141) at org.jsecurity.mgt.AuthenticatingSecurityManager.authenticate(AuthenticatingSecurityManager.java:171) at org.jsecurity.mgt.DefaultSecurityManager.login(DefaultSecurityManager.java:312) at org.jsecurity.subject.DelegatingSubject.login(DelegatingSubject.java:237) at org.sonatype.nexus.security.filter.authc.NexusHttpAuthenticationFilter.executeAnonymousLogin(NexusHttpAuthenticationFilter.java:213) at org.sonatype.nexus.security.filter.authc.NexusHttpAuthenticationFilter.onAccessDenied(NexusHttpAuthenticationFilter.java:144) at org.jsecurity.web.filter.AccessControlFilter.onPreHandle(AccessControlFilter.java:145) at org.jsecurity.web.filter.PathMatchingFilter.preHandle(PathMatchingFilter.java:175) at org.jsecurity.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:129) at org.jsecurity.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:180) at org.jsecurity.web.servlet.FilterChainWrapper.doFilter(FilterChainWrapper.java:57) at org.jsecurity.web.servlet.JSecurityFilter.doFilterInternal(JSecurityFilter.java:382) at org.jsecurity.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:180) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:387) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:864) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:539) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520) Caused by: java.net.ConnectException: Connection timed out: connect at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(Unknown Source) at java.net.PlainSocketImpl.connectToAddress(Unknown Source) at java.net.PlainSocketImpl.connect(Unknown Source) at java.net.SocksSocketImpl.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(Unknown Source) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.<init>(Unknown Source) at com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl.createSocket(Unknown Source) at sun.reflect.GeneratedMethodAccessor39.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.sun.jndi.ldap.Connection.createSocket(Unknown Source) ... 50 more {code}
    via by Rich Seddon,
  • ftp timeouts
    via areca by tombrus
    ,
  • javax.net.ssl.SSLHandshakeException
    via by 843811,
  • Archiving fails
    via Tridion by user899
    ,
    • javax.naming.CommunicationException: ldap.sonatype.com:636 [Root exception is java.net.ConnectException: Connection timed out: connect] at com.sun.jndi.ldap.Connection.<init>(Unknown Source) at com.sun.jndi.ldap.LdapClient.<init>(Unknown Source) at com.sun.jndi.ldap.LdapClient.getInstance(Unknown Source) at com.sun.jndi.ldap.LdapCtx.connect(Unknown Source) at com.sun.jndi.ldap.LdapCtx.<init>(Unknown Source) at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(Unknown Source) at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(Unknown Source) at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(Unknown Source) at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(Unknown Source) at javax.naming.spi.NamingManager.getInitialContext(Unknown Source) at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source) at javax.naming.InitialContext.init(Unknown Source) at javax.naming.ldap.InitialLdapContext.<init>(Unknown Source) at com.sonatype.security.ldap.realms.PlexusLdapContextFactory.itm(Unknown Source) at com.sonatype.security.ldap.realms.PlexusLdapContextFactory.getSystemLdapContext(Unknown Source) at com.sonatype.security.ldap.realms.ConfigurableLdapAuthenticatingRealm.queryForAuthenticationInfo(Unknown Source) at codeguard.nexusldaprealmplugin.apnpz.queryForAuthenticationInfo(Unknown Source) at org.jsecurity.realm.ldap.AbstractLdapRealm.doGetAuthenticationInfo(AbstractLdapRealm.java:186) at org.jsecurity.realm.AuthenticatingRealm.getAuthenticationInfo(AuthenticatingRealm.java:168) at org.jsecurity.authc.pam.ModularRealmAuthenticator.doMultiRealmAuthentication(ModularRealmAuthenticator.java:226) at org.jsecurity.authc.pam.ModularRealmAuthenticator.doAuthenticate(ModularRealmAuthenticator.java:278) at org.jsecurity.authc.AbstractAuthenticator.authenticate(AbstractAuthenticator.java:141) at org.jsecurity.mgt.AuthenticatingSecurityManager.authenticate(AuthenticatingSecurityManager.java:171) at org.jsecurity.mgt.DefaultSecurityManager.login(DefaultSecurityManager.java:312) at org.jsecurity.subject.DelegatingSubject.login(DelegatingSubject.java:237) at org.sonatype.nexus.security.filter.authc.NexusHttpAuthenticationFilter.executeAnonymousLogin(NexusHttpAuthenticationFilter.java:213) at org.sonatype.nexus.security.filter.authc.NexusHttpAuthenticationFilter.onAccessDenied(NexusHttpAuthenticationFilter.java:144) at org.jsecurity.web.filter.AccessControlFilter.onPreHandle(AccessControlFilter.java:145) at org.jsecurity.web.filter.PathMatchingFilter.preHandle(PathMatchingFilter.java:175) at org.jsecurity.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:129) at org.jsecurity.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:180) at org.jsecurity.web.servlet.FilterChainWrapper.doFilter(FilterChainWrapper.java:57) at org.jsecurity.web.servlet.JSecurityFilter.doFilterInternal(JSecurityFilter.java:382) at org.jsecurity.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:180) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:387) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:864) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:539) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520) Caused by: java.net.ConnectException: Connection timed out: connect at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(Unknown Source) at java.net.PlainSocketImpl.connectToAddress(Unknown Source) at java.net.PlainSocketImpl.connect(Unknown Source) at java.net.SocksSocketImpl.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(Unknown Source) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.<init>(Unknown Source) at com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl.createSocket(Unknown Source) at sun.reflect.GeneratedMethodAccessor39.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.sun.jndi.ldap.Connection.createSocket(Unknown Source) ... 50 more

    Users with the same issue

    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    ivanszkypeterivanszkypeter
    17 times, last one,
    CasperCasper
    1 times, last one,
    EricEric
    1 times, last one,
    479 more bugmates