javax.naming.CommunicationException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • 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)
    via by Timothy,
  • 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)
    via by Timothy,
  • LDAP issue
    via GitHub by totto
    ,
  • Remember: UNIX Runs Under Your JVM | Box Blog
    via by Unknown author,
  • Paged Results Collection Failing - Spring Forum
    via by Unknown author,
    • 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)

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,