javax.naming.CommunicationException: connection closed [Root exception is java.io.IOException: connection closed]; Caused by: java.io.IOException: connection closed

Oracle Community | 392 Guest | 9 years ago
  1. 0

    External LDAP connection randomly closing

    Oracle Community | 9 years ago | 392 Guest
    javax.naming.CommunicationException: connection closed [Root exception is java.io.IOException: connection closed]; Caused by: java.io.IOException: connection closed
  2. 0

    jboss jndi

    Coderanch | 7 years ago | divs sharma
    javax.naming.CommunicationException: connection closed [Root exception is java.io.IOException: connection closed]; remaining name 'uid=SuperAdmin,ou=admin,ou=SouthZone,dc=bsnl,dc=co,dc=in'
  3. 0

    In the DefaultDirContextValidator class the validateObject method catches this exception when an object in the object pool has become invalid. This is an expected outcome and is handled by the framework. The problem is that when caught the exception is logged as a warning and the exception stack trace dumped to the logs, as this is not a rare event logs are subsiquently littered with this stacktrace and warnings. Notes: ------ We use DefaultDirContextValidator in conjunction with the testOnBorrow Pooling setting. Offending Code: --------------- catch (Exception e) { this.logger.warn("DirContext '" + dirContext + "' failed validation with an exception.", e); } if (this.logger.isInfoEnabled()) { this.logger.info("DirContext '" + dirContext + "' failed validation."); } Stack Trace: ------------ [11/07/11 09:01:53:070 EST] 00000077 DefaultDirCon I org.springframework.ldap.pool.validation.DefaultDirContextValidator validateDirContext DirContext 'javax.naming.ldap.InitialLdapContext@1ace4fd' failed validation. [11/07/11 09:08:59:130 EST] 00000085 DefaultDirCon W org.springframework.ldap.pool.validation.DefaultDirContextValidator validateDirContext DirContext 'javax.naming.ldap.InitialLdapContext@14e0984' failed validation with an exception. javax.naming.CommunicationException: connection closed [Root exception is java.io.IOException: connection closed]; remaining name '' at com.sun.jndi.ldap.LdapCtx.doSearch(LdapCtx.java:1973) at com.sun.jndi.ldap.LdapCtx.searchAux(LdapCtx.java:1818) at com.sun.jndi.ldap.LdapCtx.c_search(LdapCtx.java:1743) at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_search(ComponentDirContext.java:368) at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.search(PartialCompositeDirContext.java:328) at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.search(PartialCompositeDirContext.java:313) at javax.naming.directory.InitialDirContext.search(InitialDirContext.java:238) at org.springframework.ldap.pool.validation.DefaultDirContextValidator.validateDirContext(DefaultDirContextValidator.java:154) at org.springframework.ldap.pool.factory.DirContextPoolableObjectFactory.validateObject(DirContextPoolableObjectFactory.java:169) at org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:780) at org.springframework.ldap.pool.factory.PoolingContextSource.getContext(PoolingContextSource.java:394) at org.springframework.ldap.pool.factory.PoolingContextSource.getReadOnlyContext(PoolingContextSource.java:374) at org.springframework.ldap.core.LdapTemplate.executeReadOnly(LdapTemplate.java:770) at org.springframework.ldap.core.LdapTemplate.lookup(LdapTemplate.java:865)

    Spring JIRA | 5 years ago | Timothy
    javax.naming.CommunicationException: connection closed [Root exception is java.io.IOException: connection closed]; remaining name ''
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Determining the state of an LDAP connection

    Oracle Community | 1 decade ago | 843793
    javax.naming.CommunicationException: connection closed. Root exception is java.io.IOException: connection closed
  6. 0

    In the DefaultDirContextValidator class the validateObject method catches this exception when an object in the object pool has become invalid. This is an expected outcome and is handled by the framework. The problem is that when caught the exception is logged as a warning and the exception stack trace dumped to the logs, as this is not a rare event logs are subsiquently littered with this stacktrace and warnings. Notes: ------ We use DefaultDirContextValidator in conjunction with the testOnBorrow Pooling setting. Offending Code: --------------- catch (Exception e) { this.logger.warn("DirContext '" + dirContext + "' failed validation with an exception.", e); } if (this.logger.isInfoEnabled()) { this.logger.info("DirContext '" + dirContext + "' failed validation."); } Stack Trace: ------------ [11/07/11 09:01:53:070 EST] 00000077 DefaultDirCon I org.springframework.ldap.pool.validation.DefaultDirContextValidator validateDirContext DirContext 'javax.naming.ldap.InitialLdapContext@1ace4fd' failed validation. [11/07/11 09:08:59:130 EST] 00000085 DefaultDirCon W org.springframework.ldap.pool.validation.DefaultDirContextValidator validateDirContext DirContext 'javax.naming.ldap.InitialLdapContext@14e0984' failed validation with an exception. javax.naming.CommunicationException: connection closed [Root exception is java.io.IOException: connection closed]; remaining name '' at com.sun.jndi.ldap.LdapCtx.doSearch(LdapCtx.java:1973) at com.sun.jndi.ldap.LdapCtx.searchAux(LdapCtx.java:1818) at com.sun.jndi.ldap.LdapCtx.c_search(LdapCtx.java:1743) at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_search(ComponentDirContext.java:368) at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.search(PartialCompositeDirContext.java:328) at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.search(PartialCompositeDirContext.java:313) at javax.naming.directory.InitialDirContext.search(InitialDirContext.java:238) at org.springframework.ldap.pool.validation.DefaultDirContextValidator.validateDirContext(DefaultDirContextValidator.java:154) at org.springframework.ldap.pool.factory.DirContextPoolableObjectFactory.validateObject(DirContextPoolableObjectFactory.java:169) at org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:780) at org.springframework.ldap.pool.factory.PoolingContextSource.getContext(PoolingContextSource.java:394) at org.springframework.ldap.pool.factory.PoolingContextSource.getReadOnlyContext(PoolingContextSource.java:374) at org.springframework.ldap.core.LdapTemplate.executeReadOnly(LdapTemplate.java:770) at org.springframework.ldap.core.LdapTemplate.lookup(LdapTemplate.java:865)

    Spring JIRA | 5 years ago | Timothy
    javax.naming.CommunicationException: connection closed [Root exception is java.io.IOException: connection closed]; remaining name ''

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. javax.naming.CommunicationException

      connection closed [Root exception is java.io.IOException: connection closed]; Caused by: java.io.IOException: connection closed

      at com.sun.jndi.ldap.LdapClient.ensureOpen()
    2. Java RT
      LdapCtx.doSearch
      1. com.sun.jndi.ldap.LdapClient.ensureOpen(LdapClient.java:1558)
      2. com.sun.jndi.ldap.LdapClient.search(LdapClient.java:504)
      3. com.sun.jndi.ldap.LdapCtx.doSearch(LdapCtx.java:1944)
      3 frames