我正在尝试追查CAS的一个问题,该问题导致抛出以下异常:
javax.naming.TimeLimitExceededException: [LDAP: error code 3 - Timelimit Exceeded]; remaining name ''
at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3097)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2987)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2794)
at com.sun.jndi.ldap.LdapNamingEnumeration.getNextBatch(LdapNamingEnumeration.java:129)
at com.sun.jndi.ldap.LdapNamingEnumeration.hasMoreImpl(LdapNamingEnumeration.java:198)
at com.sun.jndi.ldap.LdapNamingEnumeration.hasMore(LdapNamingEnumeration.java:171)
at org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:295)
at org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:361)...
错误几乎是立即返回的。客户端超时设置为10秒,但这并没有发生,因为根据查看com.sun.jndi.ldap代码,域控制器似乎正在返回状态为3的响应,这表明超过了时间限制。
我们正在访问Active Directory全局编录,并且我们的筛选器和基础非常广泛: base = '',filter = (proxyAddresses=*:someone@somewhere.com)然而,查询有时会成功,但会返回立即的状态代码3。
有没有人知道可能导致这种行为的原因?或者可能如何确定到底发生了什么?
发布于 2013-05-13 14:28:30
结果发现我们的搜索过滤器太宽了。
如您所见,我们在筛选器中使用了通配符,查询所用的时间不到2秒。
但是,2秒远短于Active Directory配置的时间限制,因此我无法确定错误为什么会立即发生(失败时甚至不需要2秒)。
我假设AD一定是累积了来自同一帐户的多个请求所用的时间,并且在某一时刻开始返回time limit exceeded错误。
为了解决这个问题,我们修改了搜索过滤器,使其不再包含通配符。然后,搜索几乎是瞬间运行的,并且不再超过时间限制。
https://stackoverflow.com/questions/15439694
复制相似问题