Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-12263

SocketException setting LDAP connect timeout

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • fuse-7.6-DR1
    • fuse-7.3.1
    • Karaf
    • None
    • % %
    • Hide

      JAAS config file attached.

      Show
      JAAS config file attached.
    • Fuse 7.6 - Sprint 55 (1/4)

      If I set the property "context.com.sun.jndi.ldap.connect.timeout=5000" within the LDAPLoginModule SSL setup, then I get the following exception. If you remove this line, all good. Tested with Apache DS and Microsoft AD.

      13:04:52.378 DEBUG [XNIO-3 task-22] Encryption is disabled.
      13:04:52.378 DEBUG [XNIO-3 task-22] Encryption is enabled. Using options {}
      13:04:52.379 DEBUG [XNIO-3 task-22] Get the user DN.
      13:04:52.380 DEBUG [XNIO-3 task-22] Setting up SSL
      LdapPoolManager: using authmech: simple
      com.sun.jndi.ldap.pool.Pool@16f8e2df {}.get(): localhost:10636:ssl::org.apache.karaf.jaas.modules.ldap.ManagedSSLSocketFactory:cn=fvaleri,ou=users,dc=example,dc=com
      com.sun.jndi.ldap.pool.Pool@16f8e2df {}.size: 0
      com.sun.jndi.ldap.pool.Pool@16f8e2df {}.get(): creating new connections list for localhost:10636:ssl::org.apache.karaf.jaas.modules.ldap.ManagedSSLSocketFactory:cn=fvaleri,ou=users,dc=example,dc=com
      com.sun.jndi.ldap.pool.Connections@4c4d4123.init size=1; size: 0
      com.sun.jndi.ldap.pool.Connections@4c4d4123.max size=0; size: 0
      com.sun.jndi.ldap.pool.Connections@4c4d4123.preferred size=0; size: 0
      13:04:52.381 WARN [XNIO-3 task-22] Can't connect to the LDAP server: localhost:10636
      javax.naming.CommunicationException: localhost:10636
      	at com.sun.jndi.ldap.Connection.<init>(Connection.java:228) ~[?:?]
      	at com.sun.jndi.ldap.LdapClient.<init>(LdapClient.java:137) ~[?:?]
      	at com.sun.jndi.ldap.LdapClientFactory.createPooledConnection(LdapClientFactory.java:64) ~[?:?]
      	at com.sun.jndi.ldap.pool.Connections.<init>(Connections.java:114) ~[?:?]
      	at com.sun.jndi.ldap.pool.Pool.getPooledConnection(Pool.java:136) ~[?:?]
      	at com.sun.jndi.ldap.LdapPoolManager.getLdapClient(LdapPoolManager.java:329) ~[?:?]
      	at com.sun.jndi.ldap.LdapClient.getInstance(LdapClient.java:1607) ~[?:?]
      	at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2749) ~[?:?]
      	at com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:319) ~[?:?]
      	at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:192) ~[?:?]
      	at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:210) ~[?:?]
      	at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:153) ~[?:?]
      	at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:83) ~[?:?]
      	at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684) ~[?:?]
      	at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:313) ~[?:?]
      	at javax.naming.InitialContext.init(InitialContext.java:244) ~[?:?]
      	at javax.naming.InitialContext.<init>(InitialContext.java:216) ~[?:?]
      	at javax.naming.directory.InitialDirContext.<init>(InitialDirContext.java:101) ~[?:?]
      	at org.apache.karaf.jaas.modules.ldap.LDAPCache.open(LDAPCache.java:115) ~[134:org.apache.karaf.jaas.modules:4.2.0.fuse-731003-redhat-00003]
      	at org.apache.karaf.jaas.modules.ldap.LDAPCache.doGetUserDnAndNamespace(LDAPCache.java:153) ~[134:org.apache.karaf.jaas.modules:4.2.0.fuse-731003-redhat-00003]
      	at org.apache.karaf.jaas.modules.ldap.LDAPCache.getUserDnAndNamespace(LDAPCache.java:144) ~[134:org.apache.karaf.jaas.modules:4.2.0.fuse-731003-redhat-00003]
      	at org.apache.karaf.jaas.modules.ldap.LDAPLoginModule.doLogin(LDAPLoginModule.java:116) ~[134:org.apache.karaf.jaas.modules:4.2.0.fuse-731003-redhat-00003]
      	at org.apache.karaf.jaas.modules.ldap.LDAPLoginModule.login(LDAPLoginModule.java:55) ~[134:org.apache.karaf.jaas.modules:4.2.0.fuse-731003-redhat-00003]
      	at org.apache.karaf.jaas.boot.ProxyLoginModule.login(ProxyLoginModule.java:83) ~[?:?]
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
      	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
      	at javax.security.auth.login.LoginContext.invoke(LoginContext.java:755) ~[?:?]
      	at javax.security.auth.login.LoginContext.access$000(LoginContext.java:195) ~[?:?]
      	at javax.security.auth.login.LoginContext$4.run(LoginContext.java:682) ~[?:?]
      	at javax.security.auth.login.LoginContext$4.run(LoginContext.java:680) ~[?:?]
      	at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
      	at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680) ~[?:?]
      	at javax.security.auth.login.LoginContext.login(LoginContext.java:587) ~[?:?]
      	at io.hawt.system.Authenticator.doAuthenticate(Authenticator.java:149) ~[?:?]
      	at io.hawt.system.Authenticator.authenticate(Authenticator.java:102) ~[?:?]
      	at io.hawt.web.auth.LoginServlet.doPost(LoginServlet.java:98) ~[?:?]
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:665) ~[42:javax.servlet-api:4.0.0]
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:750) ~[42:javax.servlet-api:4.0.0]
      	at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74) ~[36:io.undertow.servlet:2.0.15.Final-redhat-00001]
      	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129) ~[36:io.undertow.servlet:2.0.15.Final-redhat-00001]
      	at io.hawt.web.filters.HttpHeaderFilter.doFilter(HttpHeaderFilter.java:37) ~[?:?]
      	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[36:io.undertow.servlet:2.0.15.Final-redhat-00001]
      	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[36:io.undertow.servlet:2.0.15.Final-redhat-00001]
      	at io.hawt.web.filters.HttpHeaderFilter.doFilter(HttpHeaderFilter.java:37) ~[?:?]
      	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[36:io.undertow.servlet:2.0.15.Final-redhat-00001]
      	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[36:io.undertow.servlet:2.0.15.Final-redhat-00001]
      	at io.hawt.web.filters.HttpHeaderFilter.doFilter(HttpHeaderFilter.java:37) ~[?:?]
      	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[36:io.undertow.servlet:2.0.15.Final-redhat-00001]
      	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[36:io.undertow.servlet:2.0.15.Final-redhat-00001]
      	at io.hawt.web.filters.HttpHeaderFilter.doFilter(HttpHeaderFilter.java:37) ~[?:?]
      	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[36:io.undertow.servlet:2.0.15.Final-redhat-00001]
      	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[36:io.undertow.servlet:2.0.15.Final-redhat-00001]
      	at io.hawt.web.filters.HttpHeaderFilter.doFilter(HttpHeaderFilter.java:37) ~[?:?]
      	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[36:io.undertow.servlet:2.0.15.Final-redhat-00001]
      	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[36:io.undertow.servlet:2.0.15.Final-redhat-00001]
      	at io.hawt.web.auth.SessionExpiryFilter.process(SessionExpiryFilter.java:105) ~[?:?]
      	at io.hawt.web.auth.SessionExpiryFilter.doFilter(SessionExpiryFilter.java:58) ~[?:?]
      	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[36:io.undertow.servlet:2.0.15.Final-redhat-00001]
      	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[36:io.undertow.servlet:2.0.15.Final-redhat-00001]
      	at io.hawt.web.filters.HttpHeaderFilter.doFilter(HttpHeaderFilter.java:37) ~[?:?]
      	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[36:io.undertow.servlet:2.0.15.Final-redhat-00001]
      	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[36:io.undertow.servlet:2.0.15.Final-redhat-00001]
      	at io.hawt.web.auth.LoginRedirectFilter.doFilter(LoginRedirectFilter.java:52) ~[?:?]
      	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[36:io.undertow.servlet:2.0.15.Final-redhat-00001]
      	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[36:io.undertow.servlet:2.0.15.Final-redhat-00001]
      	at io.hawt.web.filters.HttpHeaderFilter.doFilter(HttpHeaderFilter.java:37) ~[?:?]
      	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[36:io.undertow.servlet:2.0.15.Final-redhat-00001]
      	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[36:io.undertow.servlet:2.0.15.Final-redhat-00001]
      	at io.hawt.web.filters.HttpHeaderFilter.doFilter(HttpHeaderFilter.java:37) ~[?:?]
      	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[36:io.undertow.servlet:2.0.15.Final-redhat-00001]
      	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[36:io.undertow.servlet:2.0.15.Final-redhat-00001]
      	at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84) ~[36:io.undertow.servlet:2.0.15.Final-redhat-00001]
      	at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) ~[36:io.undertow.servlet:2.0.15.Final-redhat-00001]
      	at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68) ~[36:io.undertow.servlet:2.0.15.Final-redhat-00001]
      	at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) ~[36:io.undertow.servlet:2.0.15.Final-redhat-00001]
      	at org.ops4j.pax.web.service.undertow.internal.Context$1.lambda$wrap$0(Context.java:614) ~[?:?]
      	at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:132) [36:io.undertow.servlet:2.0.15.Final-redhat-00001]
      	at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57) [36:io.undertow.servlet:2.0.15.Final-redhat-00001]
      	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [35:io.undertow.core:2.0.15.Final-redhat-00001]
      	at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46) [35:io.undertow.core:2.0.15.Final-redhat-00001]
      	at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64) [36:io.undertow.servlet:2.0.15.Final-redhat-00001]
      	at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60) [35:io.undertow.core:2.0.15.Final-redhat-00001]
      	at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77) [36:io.undertow.servlet:2.0.15.Final-redhat-00001]
      	at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43) [35:io.undertow.core:2.0.15.Final-redhat-00001]
      	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [35:io.undertow.core:2.0.15.Final-redhat-00001]
      	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [35:io.undertow.core:2.0.15.Final-redhat-00001]
      	at io.undertow.servlet.handlers.SessionRestoringHandler.handleRequest(SessionRestoringHandler.java:119) [36:io.undertow.servlet:2.0.15.Final-redhat-00001]
      	at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292) [36:io.undertow.servlet:2.0.15.Final-redhat-00001]
      	at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81) [36:io.undertow.servlet:2.0.15.Final-redhat-00001]
      	at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138) [36:io.undertow.servlet:2.0.15.Final-redhat-00001]
      	at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135) [36:io.undertow.servlet:2.0.15.Final-redhat-00001]
      	at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48) [36:io.undertow.servlet:2.0.15.Final-redhat-00001]
      	at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43) [36:io.undertow.servlet:2.0.15.Final-redhat-00001]
      	at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272) [36:io.undertow.servlet:2.0.15.Final-redhat-00001]
      	at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81) [36:io.undertow.servlet:2.0.15.Final-redhat-00001]
      	at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104) [36:io.undertow.servlet:2.0.15.Final-redhat-00001]
      	at io.undertow.server.Connectors.executeRootHandler(Connectors.java:360) [35:io.undertow.core:2.0.15.Final-redhat-00001]
      	at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830) [35:io.undertow.core:2.0.15.Final-redhat-00001]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
      	at java.lang.Thread.run(Thread.java:748) [?:?]
      Caused by: java.net.SocketException: Unconnected sockets not implemented
      	at javax.net.SocketFactory.createSocket(SocketFactory.java:125) ~[?:?]
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
      	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
      	at com.sun.jndi.ldap.Connection.createSocket(Connection.java:315) ~[?:?]
      	at com.sun.jndi.ldap.Connection.<init>(Connection.java:215) ~[?:?]
      	... 102 more
      Caused by: java.lang.UnsupportedOperationException
      	at javax.net.SocketFactory.createSocket(SocketFactory.java:123) ~[?:?]
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
      	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
      	at com.sun.jndi.ldap.Connection.createSocket(Connection.java:315) ~[?:?]
      	at com.sun.jndi.ldap.Connection.<init>(Connection.java:215) ~[?:?]
      	... 102 more
      13:04:52.388 DEBUG [XNIO-3 task-22] abort
      13:04:52.389 WARN [XNIO-3 task-22] Login failed due to: Can't connect to the LDAP server: localhost:10636
      

              ggrzybek Grzegorz Grzybek
              rhn-support-fvaleri Federico Valeri
              Vratislav Hais Vratislav Hais (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: